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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
192,900 | bandama-framework/bandama-framework | src/foundation/router/Router.php | Router.get | public function get($path, $callable, $name = null) {
return $this->add($path, $callable, $name, self::HTTP_METHOD_GET);
} | php | public function get($path, $callable, $name = null) {
return $this->add($path, $callable, $name, self::HTTP_METHOD_GET);
} | [
"public",
"function",
"get",
"(",
"$",
"path",
",",
"$",
"callable",
",",
"$",
"name",
"=",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"add",
"(",
"$",
"path",
",",
"$",
"callable",
",",
"$",
"name",
",",
"self",
"::",
"HTTP_METHOD_GET",
")",
... | Add HTTP GET method route
@see Router::add | [
"Add",
"HTTP",
"GET",
"method",
"route"
] | 234ed703baf9e31268941c9d5f6d5e004cc53066 | https://github.com/bandama-framework/bandama-framework/blob/234ed703baf9e31268941c9d5f6d5e004cc53066/src/foundation/router/Router.php#L89-L91 |
192,901 | bandama-framework/bandama-framework | src/foundation/router/Router.php | Router.post | public function post($path, $callable, $name = null) {
return $this->add($path, $callable, $name, self::HTTP_METHOD_POST);
} | php | public function post($path, $callable, $name = null) {
return $this->add($path, $callable, $name, self::HTTP_METHOD_POST);
} | [
"public",
"function",
"post",
"(",
"$",
"path",
",",
"$",
"callable",
",",
"$",
"name",
"=",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"add",
"(",
"$",
"path",
",",
"$",
"callable",
",",
"$",
"name",
",",
"self",
"::",
"HTTP_METHOD_POST",
")",... | Add HTTP POST method route
@see Router::add | [
"Add",
"HTTP",
"POST",
"method",
"route"
] | 234ed703baf9e31268941c9d5f6d5e004cc53066 | https://github.com/bandama-framework/bandama-framework/blob/234ed703baf9e31268941c9d5f6d5e004cc53066/src/foundation/router/Router.php#L98-L100 |
192,902 | bandama-framework/bandama-framework | src/foundation/router/Router.php | Router.put | public function put($path, $callable, $name = null) {
return $this->add($path, $callable, $name, self::HTTP_METHOD_PUT);
} | php | public function put($path, $callable, $name = null) {
return $this->add($path, $callable, $name, self::HTTP_METHOD_PUT);
} | [
"public",
"function",
"put",
"(",
"$",
"path",
",",
"$",
"callable",
",",
"$",
"name",
"=",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"add",
"(",
"$",
"path",
",",
"$",
"callable",
",",
"$",
"name",
",",
"self",
"::",
"HTTP_METHOD_PUT",
")",
... | Add HTTP PUT method route
@see Router::add | [
"Add",
"HTTP",
"PUT",
"method",
"route"
] | 234ed703baf9e31268941c9d5f6d5e004cc53066 | https://github.com/bandama-framework/bandama-framework/blob/234ed703baf9e31268941c9d5f6d5e004cc53066/src/foundation/router/Router.php#L107-L109 |
192,903 | bandama-framework/bandama-framework | src/foundation/router/Router.php | Router.patch | public function patch($path, $callable, $name = null) {
return $this->add($path, $callable, $name, self::HTTP_METHOD_PATCH);
} | php | public function patch($path, $callable, $name = null) {
return $this->add($path, $callable, $name, self::HTTP_METHOD_PATCH);
} | [
"public",
"function",
"patch",
"(",
"$",
"path",
",",
"$",
"callable",
",",
"$",
"name",
"=",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"add",
"(",
"$",
"path",
",",
"$",
"callable",
",",
"$",
"name",
",",
"self",
"::",
"HTTP_METHOD_PATCH",
")... | Add HTTP PATCH method route
@see Router::add | [
"Add",
"HTTP",
"PATCH",
"method",
"route"
] | 234ed703baf9e31268941c9d5f6d5e004cc53066 | https://github.com/bandama-framework/bandama-framework/blob/234ed703baf9e31268941c9d5f6d5e004cc53066/src/foundation/router/Router.php#L116-L118 |
192,904 | bandama-framework/bandama-framework | src/foundation/router/Router.php | Router.delete | public function delete($path, $callable, $name = null) {
return $this->add($path, $callable, $name, self::HTTP_METHOD_DELETE);
} | php | public function delete($path, $callable, $name = null) {
return $this->add($path, $callable, $name, self::HTTP_METHOD_DELETE);
} | [
"public",
"function",
"delete",
"(",
"$",
"path",
",",
"$",
"callable",
",",
"$",
"name",
"=",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"add",
"(",
"$",
"path",
",",
"$",
"callable",
",",
"$",
"name",
",",
"self",
"::",
"HTTP_METHOD_DELETE",
... | Add HTTP DELETE method route
@see Router::add | [
"Add",
"HTTP",
"DELETE",
"method",
"route"
] | 234ed703baf9e31268941c9d5f6d5e004cc53066 | https://github.com/bandama-framework/bandama-framework/blob/234ed703baf9e31268941c9d5f6d5e004cc53066/src/foundation/router/Router.php#L125-L127 |
192,905 | bandama-framework/bandama-framework | src/foundation/router/Router.php | Router.route | public function route($url) {
if (!isset($this->routes[$this->getHttpMethod()])) {
throw new RouterException("REQUEST_METHOD does not exist : url = $url");
}
foreach ($this->routes[$this->getHttpMethod()] as $route) {
$matches = $route->match($url);
if (is_array($matches)) {
return $route->execute(... | php | public function route($url) {
if (!isset($this->routes[$this->getHttpMethod()])) {
throw new RouterException("REQUEST_METHOD does not exist : url = $url");
}
foreach ($this->routes[$this->getHttpMethod()] as $route) {
$matches = $route->match($url);
if (is_array($matches)) {
return $route->execute(... | [
"public",
"function",
"route",
"(",
"$",
"url",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"routes",
"[",
"$",
"this",
"->",
"getHttpMethod",
"(",
")",
"]",
")",
")",
"{",
"throw",
"new",
"RouterException",
"(",
"\"REQUEST_METHOD does n... | Execute a callable of route that matchs the URL
@param string $url HTTP request URL
@throws RouterException When HTTP method doesn't exists or no route found
@return mixed | [
"Execute",
"a",
"callable",
"of",
"route",
"that",
"matchs",
"the",
"URL"
] | 234ed703baf9e31268941c9d5f6d5e004cc53066 | https://github.com/bandama-framework/bandama-framework/blob/234ed703baf9e31268941c9d5f6d5e004cc53066/src/foundation/router/Router.php#L138-L152 |
192,906 | bandama-framework/bandama-framework | src/foundation/router/Router.php | Router.add | private function add($path, $callable, $name, $method) {
$route = new Route($path, $callable);
$this->routes[$method][] = $route;
if (is_string($callable) && $name === null) {
$name = $callable;
}
// If the route has a name, add to named routes collection
if ($name) {
$this->namedRoutes[$name] = $r... | php | private function add($path, $callable, $name, $method) {
$route = new Route($path, $callable);
$this->routes[$method][] = $route;
if (is_string($callable) && $name === null) {
$name = $callable;
}
// If the route has a name, add to named routes collection
if ($name) {
$this->namedRoutes[$name] = $r... | [
"private",
"function",
"add",
"(",
"$",
"path",
",",
"$",
"callable",
",",
"$",
"name",
",",
"$",
"method",
")",
"{",
"$",
"route",
"=",
"new",
"Route",
"(",
"$",
"path",
",",
"$",
"callable",
")",
";",
"$",
"this",
"->",
"routes",
"[",
"$",
"m... | Add route to collection of routes, implements Fluent design pattern
@param string $path HTTP request path
@param string $callable Class method or function to call
@param string $name Name of route
@param string $method HTTP method e.g (GET, POST, PUT, DELETE, etc.)
@return Route | [
"Add",
"route",
"to",
"collection",
"of",
"routes",
"implements",
"Fluent",
"design",
"pattern"
] | 234ed703baf9e31268941c9d5f6d5e004cc53066 | https://github.com/bandama-framework/bandama-framework/blob/234ed703baf9e31268941c9d5f6d5e004cc53066/src/foundation/router/Router.php#L183-L198 |
192,907 | PenoaksDev/Milky-Framework | src/Milky/Exceptions/Handler.php | Handler.dontReport | public function dontReport( $exceptions )
{
$this->dontReport = array_merge( $this->dontReport, is_array( $exceptions ) ? $exceptions : [$exceptions] );
} | php | public function dontReport( $exceptions )
{
$this->dontReport = array_merge( $this->dontReport, is_array( $exceptions ) ? $exceptions : [$exceptions] );
} | [
"public",
"function",
"dontReport",
"(",
"$",
"exceptions",
")",
"{",
"$",
"this",
"->",
"dontReport",
"=",
"array_merge",
"(",
"$",
"this",
"->",
"dontReport",
",",
"is_array",
"(",
"$",
"exceptions",
")",
"?",
"$",
"exceptions",
":",
"[",
"$",
"excepti... | Adds an exception to not be reported
@param array|string $exceptions | [
"Adds",
"an",
"exception",
"to",
"not",
"be",
"reported"
] | 8afd7156610a70371aa5b1df50b8a212bf7b142c | https://github.com/PenoaksDev/Milky-Framework/blob/8afd7156610a70371aa5b1df50b8a212bf7b142c/src/Milky/Exceptions/Handler.php#L56-L59 |
192,908 | PenoaksDev/Milky-Framework | src/Milky/Exceptions/Handler.php | Handler.report | public function report( Exception $e )
{
if ( !$this->shouldReport( $e ) )
return;
try
{
$logger = Framework::log();
}
catch ( Exception $ex )
{
throw $e; // throw the original Exception
}
$logger->error( $e );
$level = $this->getLevel( $e );
$id = UniversalBuilder::resolveClass( Excep... | php | public function report( Exception $e )
{
if ( !$this->shouldReport( $e ) )
return;
try
{
$logger = Framework::log();
}
catch ( Exception $ex )
{
throw $e; // throw the original Exception
}
$logger->error( $e );
$level = $this->getLevel( $e );
$id = UniversalBuilder::resolveClass( Excep... | [
"public",
"function",
"report",
"(",
"Exception",
"$",
"e",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"shouldReport",
"(",
"$",
"e",
")",
")",
"return",
";",
"try",
"{",
"$",
"logger",
"=",
"Framework",
"::",
"log",
"(",
")",
";",
"}",
"catch"... | Report or log an Exception.
@param Exception $e | [
"Report",
"or",
"log",
"an",
"Exception",
"."
] | 8afd7156610a70371aa5b1df50b8a212bf7b142c | https://github.com/PenoaksDev/Milky-Framework/blob/8afd7156610a70371aa5b1df50b8a212bf7b142c/src/Milky/Exceptions/Handler.php#L123-L144 |
192,909 | PenoaksDev/Milky-Framework | src/Milky/Exceptions/Handler.php | Handler.getLevel | protected function getLevel( Exception $exception )
{
foreach ( array_get( $this->getConfig(), 'levels', [] ) as $class => $level )
if ( $exception instanceof $class )
return $level;
return 'error';
} | php | protected function getLevel( Exception $exception )
{
foreach ( array_get( $this->getConfig(), 'levels', [] ) as $class => $level )
if ( $exception instanceof $class )
return $level;
return 'error';
} | [
"protected",
"function",
"getLevel",
"(",
"Exception",
"$",
"exception",
")",
"{",
"foreach",
"(",
"array_get",
"(",
"$",
"this",
"->",
"getConfig",
"(",
")",
",",
"'levels'",
",",
"[",
"]",
")",
"as",
"$",
"class",
"=>",
"$",
"level",
")",
"if",
"("... | Get the exception level.
@param \Exception $exception
@return string | [
"Get",
"the",
"exception",
"level",
"."
] | 8afd7156610a70371aa5b1df50b8a212bf7b142c | https://github.com/PenoaksDev/Milky-Framework/blob/8afd7156610a70371aa5b1df50b8a212bf7b142c/src/Milky/Exceptions/Handler.php#L153-L160 |
192,910 | PenoaksDev/Milky-Framework | src/Milky/Exceptions/Handler.php | Handler.shouldReport | protected function shouldReport( Exception $e )
{
foreach ( $this->dontReport as $type )
if ( $e instanceof $type )
return false;
return true;
} | php | protected function shouldReport( Exception $e )
{
foreach ( $this->dontReport as $type )
if ( $e instanceof $type )
return false;
return true;
} | [
"protected",
"function",
"shouldReport",
"(",
"Exception",
"$",
"e",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"dontReport",
"as",
"$",
"type",
")",
"if",
"(",
"$",
"e",
"instanceof",
"$",
"type",
")",
"return",
"false",
";",
"return",
"true",
";",
... | Determine if the Exception is in the "do not report" list.
@param Exception $e
@return bool | [
"Determine",
"if",
"the",
"Exception",
"is",
"in",
"the",
"do",
"not",
"report",
"list",
"."
] | 8afd7156610a70371aa5b1df50b8a212bf7b142c | https://github.com/PenoaksDev/Milky-Framework/blob/8afd7156610a70371aa5b1df50b8a212bf7b142c/src/Milky/Exceptions/Handler.php#L168-L175 |
192,911 | PenoaksDev/Milky-Framework | src/Milky/Exceptions/Handler.php | Handler.render | public function render( $request, Exception $e )
{
$transformed = $this->getTransformed( $e );
$response = method_exists( $e, 'getResponse' ) ? $e->getResponse() : null;
if ( !$response instanceof Response )
try
{
$response = $this->getResponse( $request, $e, $transformed );
}
catch ( Exception... | php | public function render( $request, Exception $e )
{
$transformed = $this->getTransformed( $e );
$response = method_exists( $e, 'getResponse' ) ? $e->getResponse() : null;
if ( !$response instanceof Response )
try
{
$response = $this->getResponse( $request, $e, $transformed );
}
catch ( Exception... | [
"public",
"function",
"render",
"(",
"$",
"request",
",",
"Exception",
"$",
"e",
")",
"{",
"$",
"transformed",
"=",
"$",
"this",
"->",
"getTransformed",
"(",
"$",
"e",
")",
";",
"$",
"response",
"=",
"method_exists",
"(",
"$",
"e",
",",
"'getResponse'"... | Render an Exception into a response.
@param Request $request
@param Exception $e
@return Response | [
"Render",
"an",
"Exception",
"into",
"a",
"response",
"."
] | 8afd7156610a70371aa5b1df50b8a212bf7b142c | https://github.com/PenoaksDev/Milky-Framework/blob/8afd7156610a70371aa5b1df50b8a212bf7b142c/src/Milky/Exceptions/Handler.php#L184-L202 |
192,912 | PenoaksDev/Milky-Framework | src/Milky/Exceptions/Handler.php | Handler.toHttpResponse | protected function toHttpResponse( $response, Exception $e )
{
$response = new Response( $response->getContent(), $response->getStatusCode(), $response->headers->all() );
return $response->withException( $e );
} | php | protected function toHttpResponse( $response, Exception $e )
{
$response = new Response( $response->getContent(), $response->getStatusCode(), $response->headers->all() );
return $response->withException( $e );
} | [
"protected",
"function",
"toHttpResponse",
"(",
"$",
"response",
",",
"Exception",
"$",
"e",
")",
"{",
"$",
"response",
"=",
"new",
"Response",
"(",
"$",
"response",
"->",
"getContent",
"(",
")",
",",
"$",
"response",
"->",
"getStatusCode",
"(",
")",
","... | Map Exception into an response.
@param Response $response
@param Exception $e
@return Response | [
"Map",
"Exception",
"into",
"an",
"response",
"."
] | 8afd7156610a70371aa5b1df50b8a212bf7b142c | https://github.com/PenoaksDev/Milky-Framework/blob/8afd7156610a70371aa5b1df50b8a212bf7b142c/src/Milky/Exceptions/Handler.php#L211-L216 |
192,913 | PenoaksDev/Milky-Framework | src/Milky/Exceptions/Handler.php | Handler.getConfig | public function getConfig( $key = null, $def = null )
{
return Config::get( 'exceptions' . ( empty( $key ) ? "" : "." . $key ), $def );
} | php | public function getConfig( $key = null, $def = null )
{
return Config::get( 'exceptions' . ( empty( $key ) ? "" : "." . $key ), $def );
} | [
"public",
"function",
"getConfig",
"(",
"$",
"key",
"=",
"null",
",",
"$",
"def",
"=",
"null",
")",
"{",
"return",
"Config",
"::",
"get",
"(",
"'exceptions'",
".",
"(",
"empty",
"(",
"$",
"key",
")",
"?",
"\"\"",
":",
"\".\"",
".",
"$",
"key",
")... | Get exceptions configuration
@return array | [
"Get",
"exceptions",
"configuration"
] | 8afd7156610a70371aa5b1df50b8a212bf7b142c | https://github.com/PenoaksDev/Milky-Framework/blob/8afd7156610a70371aa5b1df50b8a212bf7b142c/src/Milky/Exceptions/Handler.php#L223-L226 |
192,914 | PenoaksDev/Milky-Framework | src/Milky/Exceptions/Handler.php | Handler.getResponse | protected function getResponse( Request $request, Exception $exception, Exception $transformed )
{
$id = UniversalBuilder::resolve( 'exceptions.identifier' )->identify( $exception );
$flattened = FlattenException::create( $transformed );
$code = $flattened->getStatusCode();
$headers = $flattened->getHeaders()... | php | protected function getResponse( Request $request, Exception $exception, Exception $transformed )
{
$id = UniversalBuilder::resolve( 'exceptions.identifier' )->identify( $exception );
$flattened = FlattenException::create( $transformed );
$code = $flattened->getStatusCode();
$headers = $flattened->getHeaders()... | [
"protected",
"function",
"getResponse",
"(",
"Request",
"$",
"request",
",",
"Exception",
"$",
"exception",
",",
"Exception",
"$",
"transformed",
")",
"{",
"$",
"id",
"=",
"UniversalBuilder",
"::",
"resolve",
"(",
"'exceptions.identifier'",
")",
"->",
"identify"... | Get the appropriate response object.
@param Request $request
@param \Exception $transformed
@param \Exception $exception
@return Response | [
"Get",
"the",
"appropriate",
"response",
"object",
"."
] | 8afd7156610a70371aa5b1df50b8a212bf7b142c | https://github.com/PenoaksDev/Milky-Framework/blob/8afd7156610a70371aa5b1df50b8a212bf7b142c/src/Milky/Exceptions/Handler.php#L237-L246 |
192,915 | ScaraMVC/Framework | src/Scara/Auth/Authentication.php | Authentication.check | public function check()
{
if ($this->_session->has('auth')) {
// They have an auth, let's attempt to check expiration
// and master session
$s = [
'session' => $this->_session->get('SCARA_SESSION'),
'token' => $this->_session->get('SCARA_... | php | public function check()
{
if ($this->_session->has('auth')) {
// They have an auth, let's attempt to check expiration
// and master session
$s = [
'session' => $this->_session->get('SCARA_SESSION'),
'token' => $this->_session->get('SCARA_... | [
"public",
"function",
"check",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_session",
"->",
"has",
"(",
"'auth'",
")",
")",
"{",
"// They have an auth, let's attempt to check expiration",
"// and master session",
"$",
"s",
"=",
"[",
"'session'",
"=>",
"$",
"... | Checks if a user is authenticated.
@return bool | [
"Checks",
"if",
"a",
"user",
"is",
"authenticated",
"."
] | 199b08b45fadf5dae14ac4732af03b36e15bbef2 | https://github.com/ScaraMVC/Framework/blob/199b08b45fadf5dae14ac4732af03b36e15bbef2/src/Scara/Auth/Authentication.php#L54-L77 |
192,916 | SlabPHP/cache-manager | src/Request.php | Request.setCallback | public function setCallback($object, $callbackFunction, $parameters = array())
{
$this->callbackObject = $object;
$this->callbackFunction = $callbackFunction;
$this->callbackParameters = $parameters;
return $this;
} | php | public function setCallback($object, $callbackFunction, $parameters = array())
{
$this->callbackObject = $object;
$this->callbackFunction = $callbackFunction;
$this->callbackParameters = $parameters;
return $this;
} | [
"public",
"function",
"setCallback",
"(",
"$",
"object",
",",
"$",
"callbackFunction",
",",
"$",
"parameters",
"=",
"array",
"(",
")",
")",
"{",
"$",
"this",
"->",
"callbackObject",
"=",
"$",
"object",
";",
"$",
"this",
"->",
"callbackFunction",
"=",
"$"... | Set cache callback
@param object $object
@param string $callbackFunction
@param array $parameters
@return $this | [
"Set",
"cache",
"callback"
] | 7bbf9fe6519071fe14d382e98925cd3e10010a3a | https://github.com/SlabPHP/cache-manager/blob/7bbf9fe6519071fe14d382e98925cd3e10010a3a/src/Request.php#L101-L110 |
192,917 | SlabPHP/cache-manager | src/Request.php | Request.executeCallback | public function executeCallback()
{
if (method_exists($this->callbackObject, $this->callbackFunction)) {
return call_user_func_array(array($this->callbackObject, $this->callbackFunction), $this->callbackParameters);
}
return null;
} | php | public function executeCallback()
{
if (method_exists($this->callbackObject, $this->callbackFunction)) {
return call_user_func_array(array($this->callbackObject, $this->callbackFunction), $this->callbackParameters);
}
return null;
} | [
"public",
"function",
"executeCallback",
"(",
")",
"{",
"if",
"(",
"method_exists",
"(",
"$",
"this",
"->",
"callbackObject",
",",
"$",
"this",
"->",
"callbackFunction",
")",
")",
"{",
"return",
"call_user_func_array",
"(",
"array",
"(",
"$",
"this",
"->",
... | Activate the callback function
@return mixed | [
"Activate",
"the",
"callback",
"function"
] | 7bbf9fe6519071fe14d382e98925cd3e10010a3a | https://github.com/SlabPHP/cache-manager/blob/7bbf9fe6519071fe14d382e98925cd3e10010a3a/src/Request.php#L147-L154 |
192,918 | danielgp/common-lib | source/CommonBasic.php | CommonBasic.moveFilesIntoTargetFolder | protected function moveFilesIntoTargetFolder($sourcePath, $targetPath)
{
$filesystem = new \Symfony\Component\Filesystem\Filesystem();
$filesystem->mirror($sourcePath, $targetPath);
$finder = new \Symfony\Component\Finder\Finder();
$iterator = $finder->files()->ignoreUnreadable... | php | protected function moveFilesIntoTargetFolder($sourcePath, $targetPath)
{
$filesystem = new \Symfony\Component\Filesystem\Filesystem();
$filesystem->mirror($sourcePath, $targetPath);
$finder = new \Symfony\Component\Finder\Finder();
$iterator = $finder->files()->ignoreUnreadable... | [
"protected",
"function",
"moveFilesIntoTargetFolder",
"(",
"$",
"sourcePath",
",",
"$",
"targetPath",
")",
"{",
"$",
"filesystem",
"=",
"new",
"\\",
"Symfony",
"\\",
"Component",
"\\",
"Filesystem",
"\\",
"Filesystem",
"(",
")",
";",
"$",
"filesystem",
"->",
... | Moves files into another folder
@param string $sourcePath
@param string $targetPath
@return string | [
"Moves",
"files",
"into",
"another",
"folder"
] | 627b99b4408414c7cd21a6c8016f6468dc9216b2 | https://github.com/danielgp/common-lib/blob/627b99b4408414c7cd21a6c8016f6468dc9216b2/source/CommonBasic.php#L121-L135 |
192,919 | danielgp/common-lib | source/CommonBasic.php | CommonBasic.setArrayToArrayKbr | protected function setArrayToArrayKbr(array $aElements)
{
$aReturn = [];
foreach ($aElements as $key => $value) {
$aReturn[str_replace(' ', '<br/>', $key)] = $value;
}
return $aReturn;
} | php | protected function setArrayToArrayKbr(array $aElements)
{
$aReturn = [];
foreach ($aElements as $key => $value) {
$aReturn[str_replace(' ', '<br/>', $key)] = $value;
}
return $aReturn;
} | [
"protected",
"function",
"setArrayToArrayKbr",
"(",
"array",
"$",
"aElements",
")",
"{",
"$",
"aReturn",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"aElements",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"$",
"aReturn",
"[",
"str_replace",
"(",
"' '... | Replace space with break line for each key element
@param array $aElements
@return array | [
"Replace",
"space",
"with",
"break",
"line",
"for",
"each",
"key",
"element"
] | 627b99b4408414c7cd21a6c8016f6468dc9216b2 | https://github.com/danielgp/common-lib/blob/627b99b4408414c7cd21a6c8016f6468dc9216b2/source/CommonBasic.php#L192-L199 |
192,920 | danielgp/common-lib | source/CommonBasic.php | CommonBasic.setArrayToJson | public function setArrayToJson(array $inArray)
{
$rtrn = utf8_encode(json_encode($inArray, JSON_FORCE_OBJECT | JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT));
$jsonError = $this->setJsonErrorInPlainEnglish();
if ($jsonError == '') {
$jsonError = $rtrn;
}
return... | php | public function setArrayToJson(array $inArray)
{
$rtrn = utf8_encode(json_encode($inArray, JSON_FORCE_OBJECT | JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT));
$jsonError = $this->setJsonErrorInPlainEnglish();
if ($jsonError == '') {
$jsonError = $rtrn;
}
return... | [
"public",
"function",
"setArrayToJson",
"(",
"array",
"$",
"inArray",
")",
"{",
"$",
"rtrn",
"=",
"utf8_encode",
"(",
"json_encode",
"(",
"$",
"inArray",
",",
"JSON_FORCE_OBJECT",
"|",
"JSON_UNESCAPED_SLASHES",
"|",
"JSON_PRETTY_PRINT",
")",
")",
";",
"$",
"js... | Converts an array into JSON string
@param array $inArray
@return string | [
"Converts",
"an",
"array",
"into",
"JSON",
"string"
] | 627b99b4408414c7cd21a6c8016f6468dc9216b2 | https://github.com/danielgp/common-lib/blob/627b99b4408414c7cd21a6c8016f6468dc9216b2/source/CommonBasic.php#L220-L228 |
192,921 | danielgp/common-lib | source/CommonBasic.php | CommonBasic.setJsonErrorInPlainEnglish | protected function setJsonErrorInPlainEnglish()
{
$knownErrors = [
JSON_ERROR_NONE => '',
JSON_ERROR_DEPTH => 'Maximum stack depth exceeded',
JSON_ERROR_STATE_MISMATCH => 'Underflow or the modes mismatch',
JSON_ERROR_CTRL_CHAR => 'Unexp... | php | protected function setJsonErrorInPlainEnglish()
{
$knownErrors = [
JSON_ERROR_NONE => '',
JSON_ERROR_DEPTH => 'Maximum stack depth exceeded',
JSON_ERROR_STATE_MISMATCH => 'Underflow or the modes mismatch',
JSON_ERROR_CTRL_CHAR => 'Unexp... | [
"protected",
"function",
"setJsonErrorInPlainEnglish",
"(",
")",
"{",
"$",
"knownErrors",
"=",
"[",
"JSON_ERROR_NONE",
"=>",
"''",
",",
"JSON_ERROR_DEPTH",
"=>",
"'Maximum stack depth exceeded'",
",",
"JSON_ERROR_STATE_MISMATCH",
"=>",
"'Underflow or the modes mismatch'",
"... | Provides a list of all known JSON errors and their description
@return string | [
"Provides",
"a",
"list",
"of",
"all",
"known",
"JSON",
"errors",
"and",
"their",
"description"
] | 627b99b4408414c7cd21a6c8016f6468dc9216b2 | https://github.com/danielgp/common-lib/blob/627b99b4408414c7cd21a6c8016f6468dc9216b2/source/CommonBasic.php#L235-L246 |
192,922 | cogentParadigm/behat-starbug-extension | src/Context/CsvContext.php | CsvContext.similarCsvFile | public function similarCsvFile(TableNode $filepath) {
$file = fopen($filepath, "r");
$expected = CSVTable::fromStream($file);
fclose($file);
$this->compareCsv($expected);
} | php | public function similarCsvFile(TableNode $filepath) {
$file = fopen($filepath, "r");
$expected = CSVTable::fromStream($file);
fclose($file);
$this->compareCsv($expected);
} | [
"public",
"function",
"similarCsvFile",
"(",
"TableNode",
"$",
"filepath",
")",
"{",
"$",
"file",
"=",
"fopen",
"(",
"$",
"filepath",
",",
"\"r\"",
")",
";",
"$",
"expected",
"=",
"CSVTable",
"::",
"fromStream",
"(",
"$",
"file",
")",
";",
"fclose",
"(... | CSV download with loose match.
@Then I should get a CSV similar to :filepath | [
"CSV",
"download",
"with",
"loose",
"match",
"."
] | 76da5d943773857ad2388a7cccb6632176b452a9 | https://github.com/cogentParadigm/behat-starbug-extension/blob/76da5d943773857ad2388a7cccb6632176b452a9/src/Context/CsvContext.php#L63-L68 |
192,923 | cogentParadigm/behat-starbug-extension | src/Context/CsvContext.php | CsvContext.getComparators | public function getComparators(TableNode $table) {
$comparators = [];
$headers = $table->getRow(0);
foreach ($headers as $header) {
$comparators[$header] = function ($expected, $actual) {
if (substr($expected, 0, 1) === "/") {
return preg_match($expected, $actual);
} else {
... | php | public function getComparators(TableNode $table) {
$comparators = [];
$headers = $table->getRow(0);
foreach ($headers as $header) {
$comparators[$header] = function ($expected, $actual) {
if (substr($expected, 0, 1) === "/") {
return preg_match($expected, $actual);
} else {
... | [
"public",
"function",
"getComparators",
"(",
"TableNode",
"$",
"table",
")",
"{",
"$",
"comparators",
"=",
"[",
"]",
";",
"$",
"headers",
"=",
"$",
"table",
"->",
"getRow",
"(",
"0",
")",
";",
"foreach",
"(",
"$",
"headers",
"as",
"$",
"header",
")",... | Helper method to generate generic regex comparators. | [
"Helper",
"method",
"to",
"generate",
"generic",
"regex",
"comparators",
"."
] | 76da5d943773857ad2388a7cccb6632176b452a9 | https://github.com/cogentParadigm/behat-starbug-extension/blob/76da5d943773857ad2388a7cccb6632176b452a9/src/Context/CsvContext.php#L73-L86 |
192,924 | ringoteam/RingoPhpRedmonBundle | Controller/SearchController.php | SearchController.indexAction | public function indexAction()
{
$results = array();
$key = '';
$db = '-1';
if($this->getRequest()->isMethod('POST')) {
$key = $this->getRequest()->get('key');
$db = $this->getRequest()->get('database');
$keys = $this->getWorker()->keys($key, $... | php | public function indexAction()
{
$results = array();
$key = '';
$db = '-1';
if($this->getRequest()->isMethod('POST')) {
$key = $this->getRequest()->get('key');
$db = $this->getRequest()->get('database');
$keys = $this->getWorker()->keys($key, $... | [
"public",
"function",
"indexAction",
"(",
")",
"{",
"$",
"results",
"=",
"array",
"(",
")",
";",
"$",
"key",
"=",
"''",
";",
"$",
"db",
"=",
"'-1'",
";",
"if",
"(",
"$",
"this",
"->",
"getRequest",
"(",
")",
"->",
"isMethod",
"(",
"'POST'",
")",
... | Search index action
@return \Symfony\Component\HttpFoundation\Response | [
"Search",
"index",
"action"
] | 9aab989a9bee9e6152ec19f8a30bc24f3bde6012 | https://github.com/ringoteam/RingoPhpRedmonBundle/blob/9aab989a9bee9e6152ec19f8a30bc24f3bde6012/Controller/SearchController.php#L27-L63 |
192,925 | gplcart/dev | Main.php | Main.setLogger | protected function setLogger()
{
$settings = $this->module->getSettings('dev');
$this->logger->printError(!empty($settings['print_error']))
->errorToException(!empty($settings['error_to_exception']))
->printBacktrace(!empty($settings['print_error_backtrace']));
} | php | protected function setLogger()
{
$settings = $this->module->getSettings('dev');
$this->logger->printError(!empty($settings['print_error']))
->errorToException(!empty($settings['error_to_exception']))
->printBacktrace(!empty($settings['print_error_backtrace']));
} | [
"protected",
"function",
"setLogger",
"(",
")",
"{",
"$",
"settings",
"=",
"$",
"this",
"->",
"module",
"->",
"getSettings",
"(",
"'dev'",
")",
";",
"$",
"this",
"->",
"logger",
"->",
"printError",
"(",
"!",
"empty",
"(",
"$",
"settings",
"[",
"'print_... | Configure system logger | [
"Configure",
"system",
"logger"
] | 81352a220995a8db1e2b2bff73997780d1500f09 | https://github.com/gplcart/dev/blob/81352a220995a8db1e2b2bff73997780d1500f09/Main.php#L186-L193 |
192,926 | ekyna/Table | Bridge/Doctrine/ORM/Util/FilterUtil.php | FilterUtil.buildExpression | static public function buildExpression($property, $operator, $parameter = null)
{
FilterOperator::isValid($operator, true);
$expr = new Expr();
switch (intval($operator)) {
case FilterOperator::NOT_EQUAL:
return $expr->neq($property, $parameter);
case... | php | static public function buildExpression($property, $operator, $parameter = null)
{
FilterOperator::isValid($operator, true);
$expr = new Expr();
switch (intval($operator)) {
case FilterOperator::NOT_EQUAL:
return $expr->neq($property, $parameter);
case... | [
"static",
"public",
"function",
"buildExpression",
"(",
"$",
"property",
",",
"$",
"operator",
",",
"$",
"parameter",
"=",
"null",
")",
"{",
"FilterOperator",
"::",
"isValid",
"(",
"$",
"operator",
",",
"true",
")",
";",
"$",
"expr",
"=",
"new",
"Expr",
... | Builds the query builder expression.
@param string $property
@param string $operator
@param string $parameter
@return string|Expr\Comparison|Expr\Func | [
"Builds",
"the",
"query",
"builder",
"expression",
"."
] | 6f06e8fd8a3248d52f3a91f10508471344db311a | https://github.com/ekyna/Table/blob/6f06e8fd8a3248d52f3a91f10508471344db311a/Bridge/Doctrine/ORM/Util/FilterUtil.php#L30-L73 |
192,927 | ekyna/Table | Bridge/Doctrine/ORM/Util/FilterUtil.php | FilterUtil.buildParameterValue | static public function buildParameterValue($operator, $value)
{
FilterOperator::isValid($operator, true);
switch (intval($operator)) {
case FilterOperator::LIKE:
case FilterOperator::NOT_LIKE:
return sprintf('%%%s%%', $value);
case FilterOperator:... | php | static public function buildParameterValue($operator, $value)
{
FilterOperator::isValid($operator, true);
switch (intval($operator)) {
case FilterOperator::LIKE:
case FilterOperator::NOT_LIKE:
return sprintf('%%%s%%', $value);
case FilterOperator:... | [
"static",
"public",
"function",
"buildParameterValue",
"(",
"$",
"operator",
",",
"$",
"value",
")",
"{",
"FilterOperator",
"::",
"isValid",
"(",
"$",
"operator",
",",
"true",
")",
";",
"switch",
"(",
"intval",
"(",
"$",
"operator",
")",
")",
"{",
"case"... | Builds the query builder parameter value.
@param string $operator
@param mixed $value
@return Expr\Literal|mixed | [
"Builds",
"the",
"query",
"builder",
"parameter",
"value",
"."
] | 6f06e8fd8a3248d52f3a91f10508471344db311a | https://github.com/ekyna/Table/blob/6f06e8fd8a3248d52f3a91f10508471344db311a/Bridge/Doctrine/ORM/Util/FilterUtil.php#L95-L112 |
192,928 | brightnucleus/values | src/Value/AbstractValue.php | AbstractValue.escape | public function escape(string $target = EscapeTarget::HTML)
{
switch ($target) {
case EscapeTarget::ATTRIBUTE:
return $this->escapeAttribute();
case EscapeTarget::JS:
return $this->escapeJS();
case EscapeTarget::HTML:
default:
... | php | public function escape(string $target = EscapeTarget::HTML)
{
switch ($target) {
case EscapeTarget::ATTRIBUTE:
return $this->escapeAttribute();
case EscapeTarget::JS:
return $this->escapeJS();
case EscapeTarget::HTML:
default:
... | [
"public",
"function",
"escape",
"(",
"string",
"$",
"target",
"=",
"EscapeTarget",
"::",
"HTML",
")",
"{",
"switch",
"(",
"$",
"target",
")",
"{",
"case",
"EscapeTarget",
"::",
"ATTRIBUTE",
":",
"return",
"$",
"this",
"->",
"escapeAttribute",
"(",
")",
"... | Get an escaped version of the value.
@since 0.1.0
@param string $target Optional. Escaping target to use. Defaults to HTML.
@return mixed Sanitized version of the value. | [
"Get",
"an",
"escaped",
"version",
"of",
"the",
"value",
"."
] | e9bdfbec949f6f964631aacaccaa98a0f13d916f | https://github.com/brightnucleus/values/blob/e9bdfbec949f6f964631aacaccaa98a0f13d916f/src/Value/AbstractValue.php#L186-L197 |
192,929 | brightnucleus/values | src/Value/AbstractValue.php | AbstractValue.initializeValue | protected function initializeValue($value)
{
if ($this->isEmpty($value) && ! $this->flags & Value::CAN_BE_EMPTY) {
throw FailedToValidate::fromValueForClass($value, $this);
}
if (! $this->isEmpty($value)) {
$value = $this->validate($value);
}
if (nul... | php | protected function initializeValue($value)
{
if ($this->isEmpty($value) && ! $this->flags & Value::CAN_BE_EMPTY) {
throw FailedToValidate::fromValueForClass($value, $this);
}
if (! $this->isEmpty($value)) {
$value = $this->validate($value);
}
if (nul... | [
"protected",
"function",
"initializeValue",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isEmpty",
"(",
"$",
"value",
")",
"&&",
"!",
"$",
"this",
"->",
"flags",
"&",
"Value",
"::",
"CAN_BE_EMPTY",
")",
"{",
"throw",
"FailedToValidate",
... | Initialize the value.
@since 0.1.1
@param $value | [
"Initialize",
"the",
"value",
"."
] | e9bdfbec949f6f964631aacaccaa98a0f13d916f | https://github.com/brightnucleus/values/blob/e9bdfbec949f6f964631aacaccaa98a0f13d916f/src/Value/AbstractValue.php#L232-L247 |
192,930 | brightnucleus/values | src/Value/AbstractValue.php | AbstractValue.validateEncoding | protected function validateEncoding(): string
{
if (function_exists('mb_check_encoding')
&& mb_check_encoding($this->value, 'UTF-8')
) {
return $this->value;
}
return function_exists('iconv')
? iconv('utf-8', 'utf-8', $this->value)
: '... | php | protected function validateEncoding(): string
{
if (function_exists('mb_check_encoding')
&& mb_check_encoding($this->value, 'UTF-8')
) {
return $this->value;
}
return function_exists('iconv')
? iconv('utf-8', 'utf-8', $this->value)
: '... | [
"protected",
"function",
"validateEncoding",
"(",
")",
":",
"string",
"{",
"if",
"(",
"function_exists",
"(",
"'mb_check_encoding'",
")",
"&&",
"mb_check_encoding",
"(",
"$",
"this",
"->",
"value",
",",
"'UTF-8'",
")",
")",
"{",
"return",
"$",
"this",
"->",
... | Make sure the value is correctly encoded UTF-8.
This prevents the so-called "Invalid Encoding Attack".
@since 0.1.0
@return string Valid UTF-8 encoded string. | [
"Make",
"sure",
"the",
"value",
"is",
"correctly",
"encoded",
"UTF",
"-",
"8",
"."
] | e9bdfbec949f6f964631aacaccaa98a0f13d916f | https://github.com/brightnucleus/values/blob/e9bdfbec949f6f964631aacaccaa98a0f13d916f/src/Value/AbstractValue.php#L258-L269 |
192,931 | brightnucleus/values | src/Value/AbstractValue.php | AbstractValue.escapeAttribute | protected function escapeAttribute(): string
{
$value = $this->validateEncoding();
$value = strip_tags($value);
return htmlspecialchars($value, ENT_QUOTES);
} | php | protected function escapeAttribute(): string
{
$value = $this->validateEncoding();
$value = strip_tags($value);
return htmlspecialchars($value, ENT_QUOTES);
} | [
"protected",
"function",
"escapeAttribute",
"(",
")",
":",
"string",
"{",
"$",
"value",
"=",
"$",
"this",
"->",
"validateEncoding",
"(",
")",
";",
"$",
"value",
"=",
"strip_tags",
"(",
"$",
"value",
")",
";",
"return",
"htmlspecialchars",
"(",
"$",
"valu... | Escape the value to be used as a HTML attribute.
@since 0.1.0
@return string | [
"Escape",
"the",
"value",
"to",
"be",
"used",
"as",
"a",
"HTML",
"attribute",
"."
] | e9bdfbec949f6f964631aacaccaa98a0f13d916f | https://github.com/brightnucleus/values/blob/e9bdfbec949f6f964631aacaccaa98a0f13d916f/src/Value/AbstractValue.php#L292-L298 |
192,932 | brightnucleus/values | src/Value/AbstractValue.php | AbstractValue.escapeJS | protected function escapeJS(): string
{
$value = $this->validateEncoding();
$value = htmlspecialchars($value, ENT_COMPAT);
$value = preg_replace('/&#(x)?0*(?(1)27|39);?/i', '\'', stripslashes($value));
$value = str_replace("\r", '', $value);
return str_replace("\n", '\\n', ... | php | protected function escapeJS(): string
{
$value = $this->validateEncoding();
$value = htmlspecialchars($value, ENT_COMPAT);
$value = preg_replace('/&#(x)?0*(?(1)27|39);?/i', '\'', stripslashes($value));
$value = str_replace("\r", '', $value);
return str_replace("\n", '\\n', ... | [
"protected",
"function",
"escapeJS",
"(",
")",
":",
"string",
"{",
"$",
"value",
"=",
"$",
"this",
"->",
"validateEncoding",
"(",
")",
";",
"$",
"value",
"=",
"htmlspecialchars",
"(",
"$",
"value",
",",
"ENT_COMPAT",
")",
";",
"$",
"value",
"=",
"preg_... | Escape the value to be used within JavaScript.
@since 0.1.0
@return string | [
"Escape",
"the",
"value",
"to",
"be",
"used",
"within",
"JavaScript",
"."
] | e9bdfbec949f6f964631aacaccaa98a0f13d916f | https://github.com/brightnucleus/values/blob/e9bdfbec949f6f964631aacaccaa98a0f13d916f/src/Value/AbstractValue.php#L307-L316 |
192,933 | cubicmushroom/valueobjects | src/Money/Currency.php | Currency.sameValueAs | public function sameValueAs(ValueObjectInterface $currency)
{
if (false === Util::classEquals($this, $currency)) {
return false;
}
return $this->getCode()->toNative() == $currency->getCode()->toNative();
} | php | public function sameValueAs(ValueObjectInterface $currency)
{
if (false === Util::classEquals($this, $currency)) {
return false;
}
return $this->getCode()->toNative() == $currency->getCode()->toNative();
} | [
"public",
"function",
"sameValueAs",
"(",
"ValueObjectInterface",
"$",
"currency",
")",
"{",
"if",
"(",
"false",
"===",
"Util",
"::",
"classEquals",
"(",
"$",
"this",
",",
"$",
"currency",
")",
")",
"{",
"return",
"false",
";",
"}",
"return",
"$",
"this"... | Tells whether two Currency are equal by comparing their names
@param ValueObjectInterface $currency
@return bool | [
"Tells",
"whether",
"two",
"Currency",
"are",
"equal",
"by",
"comparing",
"their",
"names"
] | 4554239ab75d65eeb9773219aa5b07e9fbfabb92 | https://github.com/cubicmushroom/valueobjects/blob/4554239ab75d65eeb9773219aa5b07e9fbfabb92/src/Money/Currency.php#L42-L49 |
192,934 | as3io/As3ModlrBundle | DependencyInjection/ServiceLoader/MetadataCache.php | MetadataCache.createBundleCacheWarmer | private function createBundleCacheWarmer($warmerName)
{
$definition = new Definition(
Utility::getBundleClass('CacheWarmer\MetadataWarmer'),
[new Reference($warmerName)]
);
$definition->setPublic(false);
$definition->addTag('kernel.cache_warmer');
retu... | php | private function createBundleCacheWarmer($warmerName)
{
$definition = new Definition(
Utility::getBundleClass('CacheWarmer\MetadataWarmer'),
[new Reference($warmerName)]
);
$definition->setPublic(false);
$definition->addTag('kernel.cache_warmer');
retu... | [
"private",
"function",
"createBundleCacheWarmer",
"(",
"$",
"warmerName",
")",
"{",
"$",
"definition",
"=",
"new",
"Definition",
"(",
"Utility",
"::",
"getBundleClass",
"(",
"'CacheWarmer\\MetadataWarmer'",
")",
",",
"[",
"new",
"Reference",
"(",
"$",
"warmerName"... | Creates the bundle cache warmer definition.
@param string $warmerName
@return Definition | [
"Creates",
"the",
"bundle",
"cache",
"warmer",
"definition",
"."
] | 7ce2abb7390c7eaf4081c5b7e00b96e7001774a4 | https://github.com/as3io/As3ModlrBundle/blob/7ce2abb7390c7eaf4081c5b7e00b96e7001774a4/DependencyInjection/ServiceLoader/MetadataCache.php#L23-L32 |
192,935 | as3io/As3ModlrBundle | DependencyInjection/ServiceLoader/MetadataCache.php | MetadataCache.createCacheClearCommand | private function createCacheClearCommand($warmerName)
{
$definition = new Definition(
Utility::getBundleClass('Command\Metadata\ClearCacheCommand'),
[new Reference($warmerName)]
);
$definition->addTag('console.command');
return $definition;
} | php | private function createCacheClearCommand($warmerName)
{
$definition = new Definition(
Utility::getBundleClass('Command\Metadata\ClearCacheCommand'),
[new Reference($warmerName)]
);
$definition->addTag('console.command');
return $definition;
} | [
"private",
"function",
"createCacheClearCommand",
"(",
"$",
"warmerName",
")",
"{",
"$",
"definition",
"=",
"new",
"Definition",
"(",
"Utility",
"::",
"getBundleClass",
"(",
"'Command\\Metadata\\ClearCacheCommand'",
")",
",",
"[",
"new",
"Reference",
"(",
"$",
"wa... | Creates the cache clear command definition.
@param string $warmerName
@return Definition | [
"Creates",
"the",
"cache",
"clear",
"command",
"definition",
"."
] | 7ce2abb7390c7eaf4081c5b7e00b96e7001774a4 | https://github.com/as3io/As3ModlrBundle/blob/7ce2abb7390c7eaf4081c5b7e00b96e7001774a4/DependencyInjection/ServiceLoader/MetadataCache.php#L40-L48 |
192,936 | as3io/As3ModlrBundle | DependencyInjection/ServiceLoader/MetadataCache.php | MetadataCache.createFileCache | private function createFileCache($subClassName, array $cacheConfig, ContainerBuilder $container)
{
$cacheDir = $this->getFileCacheDir($cacheConfig, $container);
Utility::appendParameter('dirs', 'metadata_cache_dir', $cacheDir, $container);
return new Definition(
Utility::getLibr... | php | private function createFileCache($subClassName, array $cacheConfig, ContainerBuilder $container)
{
$cacheDir = $this->getFileCacheDir($cacheConfig, $container);
Utility::appendParameter('dirs', 'metadata_cache_dir', $cacheDir, $container);
return new Definition(
Utility::getLibr... | [
"private",
"function",
"createFileCache",
"(",
"$",
"subClassName",
",",
"array",
"$",
"cacheConfig",
",",
"ContainerBuilder",
"$",
"container",
")",
"{",
"$",
"cacheDir",
"=",
"$",
"this",
"->",
"getFileCacheDir",
"(",
"$",
"cacheConfig",
",",
"$",
"container... | Creates a file cache service definition.
@param string $subClassName
@param array $cacheConfig
@param ContainerBuilder $container
@return Definition | [
"Creates",
"a",
"file",
"cache",
"service",
"definition",
"."
] | 7ce2abb7390c7eaf4081c5b7e00b96e7001774a4 | https://github.com/as3io/As3ModlrBundle/blob/7ce2abb7390c7eaf4081c5b7e00b96e7001774a4/DependencyInjection/ServiceLoader/MetadataCache.php#L73-L82 |
192,937 | as3io/As3ModlrBundle | DependencyInjection/ServiceLoader/MetadataCache.php | MetadataCache.getFileCacheDir | private function getFileCacheDir(array $cacheConfig, ContainerBuilder $container)
{
$dir = sprintf('%s/as3_modlr', $container->getParameter('kernel.cache_dir'));
if (isset($cacheConfig['parameters']['dir'])) {
$dir = $cacheConfig['parameters']['dir'];
}
return $dir;
} | php | private function getFileCacheDir(array $cacheConfig, ContainerBuilder $container)
{
$dir = sprintf('%s/as3_modlr', $container->getParameter('kernel.cache_dir'));
if (isset($cacheConfig['parameters']['dir'])) {
$dir = $cacheConfig['parameters']['dir'];
}
return $dir;
} | [
"private",
"function",
"getFileCacheDir",
"(",
"array",
"$",
"cacheConfig",
",",
"ContainerBuilder",
"$",
"container",
")",
"{",
"$",
"dir",
"=",
"sprintf",
"(",
"'%s/as3_modlr'",
",",
"$",
"container",
"->",
"getParameter",
"(",
"'kernel.cache_dir'",
")",
")",
... | Gets the file cache directory.
@param array $cacheConfig
@param ContainerBuilder $container
@return string | [
"Gets",
"the",
"file",
"cache",
"directory",
"."
] | 7ce2abb7390c7eaf4081c5b7e00b96e7001774a4 | https://github.com/as3io/As3ModlrBundle/blob/7ce2abb7390c7eaf4081c5b7e00b96e7001774a4/DependencyInjection/ServiceLoader/MetadataCache.php#L105-L112 |
192,938 | as3io/As3ModlrBundle | DependencyInjection/ServiceLoader/MetadataCache.php | MetadataCache.loadCacheWarming | private function loadCacheWarming(ContainerBuilder $container)
{
// Root cache warmer
$warmerName = Utility::getAliasedName('metadata.cache.warmer');
$definition = $this->createCacheWarmer($container);
$container->setDefinition($warmerName, $definition);
// Bundle wrapped ca... | php | private function loadCacheWarming(ContainerBuilder $container)
{
// Root cache warmer
$warmerName = Utility::getAliasedName('metadata.cache.warmer');
$definition = $this->createCacheWarmer($container);
$container->setDefinition($warmerName, $definition);
// Bundle wrapped ca... | [
"private",
"function",
"loadCacheWarming",
"(",
"ContainerBuilder",
"$",
"container",
")",
"{",
"// Root cache warmer",
"$",
"warmerName",
"=",
"Utility",
"::",
"getAliasedName",
"(",
"'metadata.cache.warmer'",
")",
";",
"$",
"definition",
"=",
"$",
"this",
"->",
... | Loads cache warming services.
@param ContainerBuilder $container
@return self | [
"Loads",
"cache",
"warming",
"services",
"."
] | 7ce2abb7390c7eaf4081c5b7e00b96e7001774a4 | https://github.com/as3io/As3ModlrBundle/blob/7ce2abb7390c7eaf4081c5b7e00b96e7001774a4/DependencyInjection/ServiceLoader/MetadataCache.php#L160-L176 |
192,939 | modulusphp/support | Config.php | Config.has | public static function has(string $key) : bool
{
$expect = explode('.', $key);
$config = Config::all();
foreach($expect as $setting) {
if (!isset($config[$setting])) return false;
$config = $config[$setting];
}
return true;
} | php | public static function has(string $key) : bool
{
$expect = explode('.', $key);
$config = Config::all();
foreach($expect as $setting) {
if (!isset($config[$setting])) return false;
$config = $config[$setting];
}
return true;
} | [
"public",
"static",
"function",
"has",
"(",
"string",
"$",
"key",
")",
":",
"bool",
"{",
"$",
"expect",
"=",
"explode",
"(",
"'.'",
",",
"$",
"key",
")",
";",
"$",
"config",
"=",
"Config",
"::",
"all",
"(",
")",
";",
"foreach",
"(",
"$",
"expect"... | Check if setting exists
@param string $key
@return bool | [
"Check",
"if",
"setting",
"exists"
] | b5c5b48dcbeb379e6cd1f29159dc8cdacef3adab | https://github.com/modulusphp/support/blob/b5c5b48dcbeb379e6cd1f29159dc8cdacef3adab/Config.php#L22-L33 |
192,940 | fulgurio/LightCMSBundle | Utils/MediaLibrary.php | MediaLibrary.getUniqFilename | private function getUniqFilename($path, $filename, $counter = 0)
{
if (($pos = mb_strrpos($filename, '.')) == FALSE)
{
$file = $filename;
$extension = '';
}
else
{
$file = mb_substr($filename, 0, $pos);
$extension = mb_substr($f... | php | private function getUniqFilename($path, $filename, $counter = 0)
{
if (($pos = mb_strrpos($filename, '.')) == FALSE)
{
$file = $filename;
$extension = '';
}
else
{
$file = mb_substr($filename, 0, $pos);
$extension = mb_substr($f... | [
"private",
"function",
"getUniqFilename",
"(",
"$",
"path",
",",
"$",
"filename",
",",
"$",
"counter",
"=",
"0",
")",
"{",
"if",
"(",
"(",
"$",
"pos",
"=",
"mb_strrpos",
"(",
"$",
"filename",
",",
"'.'",
")",
")",
"==",
"FALSE",
")",
"{",
"$",
"f... | Get uniq name for upload
@param string $path
@param string $filename
@param number $counter
@return string | [
"Get",
"uniq",
"name",
"for",
"upload"
] | 66319af52b97b6552b7c391ee370538263f42d10 | https://github.com/fulgurio/LightCMSBundle/blob/66319af52b97b6552b7c391ee370538263f42d10/Utils/MediaLibrary.php#L93-L111 |
192,941 | ScaraMVC/Framework | src/Scara/Routing/RouteLoader.php | RouteLoader.getRequestedRoute | public function getRequestedRoute($basepath)
{
if ($basepath == '/') {
$url = strtolower($_SERVER['REQUEST_URI']);
} else {
$url = explode($basepath, strtolower($_SERVER['REQUEST_URI']))[1];
}
return $this->_router->getRoute($url);
} | php | public function getRequestedRoute($basepath)
{
if ($basepath == '/') {
$url = strtolower($_SERVER['REQUEST_URI']);
} else {
$url = explode($basepath, strtolower($_SERVER['REQUEST_URI']))[1];
}
return $this->_router->getRoute($url);
} | [
"public",
"function",
"getRequestedRoute",
"(",
"$",
"basepath",
")",
"{",
"if",
"(",
"$",
"basepath",
"==",
"'/'",
")",
"{",
"$",
"url",
"=",
"strtolower",
"(",
"$",
"_SERVER",
"[",
"'REQUEST_URI'",
"]",
")",
";",
"}",
"else",
"{",
"$",
"url",
"=",
... | Gets the requested route for the controller.
@param string $basepath - Application's base path
@return array | [
"Gets",
"the",
"requested",
"route",
"for",
"the",
"controller",
"."
] | 199b08b45fadf5dae14ac4732af03b36e15bbef2 | https://github.com/ScaraMVC/Framework/blob/199b08b45fadf5dae14ac4732af03b36e15bbef2/src/Scara/Routing/RouteLoader.php#L37-L46 |
192,942 | Linkvalue-Interne/MajoraFrameworkExtraBundle | src/Majora/Framework/Domain/Action/ActionFactory.php | ActionFactory.createAction | public function createAction($name)
{
if (!$this->actions->containsKey($name)) {
throw new \InvalidArgumentException(sprintf(
'Any action registered under "%s" name, only ["%s"] are.',
$name,
implode('","', $this->actions->getKeys())
))... | php | public function createAction($name)
{
if (!$this->actions->containsKey($name)) {
throw new \InvalidArgumentException(sprintf(
'Any action registered under "%s" name, only ["%s"] are.',
$name,
implode('","', $this->actions->getKeys())
))... | [
"public",
"function",
"createAction",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"actions",
"->",
"containsKey",
"(",
"$",
"name",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"sprintf",
"(",
"'Any action regist... | Creates and return a new action under given name
@param string $name
@return ActionInterface | [
"Creates",
"and",
"return",
"a",
"new",
"action",
"under",
"given",
"name"
] | 6f368380cfc39d27fafb0844e9a53b4d86d7c034 | https://github.com/Linkvalue-Interne/MajoraFrameworkExtraBundle/blob/6f368380cfc39d27fafb0844e9a53b4d86d7c034/src/Majora/Framework/Domain/Action/ActionFactory.php#L49-L60 |
192,943 | staticka/staticka | src/Helper/ViewHelper.php | ViewHelper.render | public function render($template, array $data = array())
{
$data = array_merge($data, $this->website->helpers());
$data['config'] = $this->website;
$renderer = $this->website->renderer();
return $renderer->render($template, $data);
} | php | public function render($template, array $data = array())
{
$data = array_merge($data, $this->website->helpers());
$data['config'] = $this->website;
$renderer = $this->website->renderer();
return $renderer->render($template, $data);
} | [
"public",
"function",
"render",
"(",
"$",
"template",
",",
"array",
"$",
"data",
"=",
"array",
"(",
")",
")",
"{",
"$",
"data",
"=",
"array_merge",
"(",
"$",
"data",
",",
"$",
"this",
"->",
"website",
"->",
"helpers",
"(",
")",
")",
";",
"$",
"da... | Renders the partial template.
@param string $template
@param array $data
@return string | [
"Renders",
"the",
"partial",
"template",
"."
] | 6e3b814c391ed03b0bd409803e11579bae677ce4 | https://github.com/staticka/staticka/blob/6e3b814c391ed03b0bd409803e11579bae677ce4/src/Helper/ViewHelper.php#L37-L46 |
192,944 | Linkvalue-Interne/MajoraFrameworkExtraBundle | src/Majora/Bundle/FrameworkExtraBundle/Event/ClockSubscriber.php | ClockSubscriber.onKernelRequest | public function onKernelRequest(GetResponseEvent $event)
{
$request = $event->getRequest();
if (!$strMockedDate = $request->query->get($this->mockParamName)) {
return;
}
$this->mock($strMockedDate);
} | php | public function onKernelRequest(GetResponseEvent $event)
{
$request = $event->getRequest();
if (!$strMockedDate = $request->query->get($this->mockParamName)) {
return;
}
$this->mock($strMockedDate);
} | [
"public",
"function",
"onKernelRequest",
"(",
"GetResponseEvent",
"$",
"event",
")",
"{",
"$",
"request",
"=",
"$",
"event",
"->",
"getRequest",
"(",
")",
";",
"if",
"(",
"!",
"$",
"strMockedDate",
"=",
"$",
"request",
"->",
"query",
"->",
"get",
"(",
... | kernel request event handler | [
"kernel",
"request",
"event",
"handler"
] | 6f368380cfc39d27fafb0844e9a53b4d86d7c034 | https://github.com/Linkvalue-Interne/MajoraFrameworkExtraBundle/blob/6f368380cfc39d27fafb0844e9a53b4d86d7c034/src/Majora/Bundle/FrameworkExtraBundle/Event/ClockSubscriber.php#L47-L55 |
192,945 | Linkvalue-Interne/MajoraFrameworkExtraBundle | src/Majora/Bundle/FrameworkExtraBundle/Event/ClockSubscriber.php | ClockSubscriber.onConsoleCommand | public function onConsoleCommand(ConsoleCommandEvent $event)
{
$input = $event->getInput();
if (!$input->hasOption($this->mockParamName)) {
return;
}
$this->mock($input->getOption($this->mockParamName));
} | php | public function onConsoleCommand(ConsoleCommandEvent $event)
{
$input = $event->getInput();
if (!$input->hasOption($this->mockParamName)) {
return;
}
$this->mock($input->getOption($this->mockParamName));
} | [
"public",
"function",
"onConsoleCommand",
"(",
"ConsoleCommandEvent",
"$",
"event",
")",
"{",
"$",
"input",
"=",
"$",
"event",
"->",
"getInput",
"(",
")",
";",
"if",
"(",
"!",
"$",
"input",
"->",
"hasOption",
"(",
"$",
"this",
"->",
"mockParamName",
")",... | console command event handler | [
"console",
"command",
"event",
"handler"
] | 6f368380cfc39d27fafb0844e9a53b4d86d7c034 | https://github.com/Linkvalue-Interne/MajoraFrameworkExtraBundle/blob/6f368380cfc39d27fafb0844e9a53b4d86d7c034/src/Majora/Bundle/FrameworkExtraBundle/Event/ClockSubscriber.php#L60-L68 |
192,946 | cubicmushroom/valueobjects | src/DateTime/DateTimeWithTimeZone.php | DateTimeWithTimeZone.sameValueAs | public function sameValueAs(ValueObjectInterface $dateTimeWithTimeZone)
{
if (false === Util::classEquals($this, $dateTimeWithTimeZone)) {
return false;
}
return $this->getDateTime()->sameValueAs($dateTimeWithTimeZone->getDateTime()) &&
$this->getTimeZone()->sameValu... | php | public function sameValueAs(ValueObjectInterface $dateTimeWithTimeZone)
{
if (false === Util::classEquals($this, $dateTimeWithTimeZone)) {
return false;
}
return $this->getDateTime()->sameValueAs($dateTimeWithTimeZone->getDateTime()) &&
$this->getTimeZone()->sameValu... | [
"public",
"function",
"sameValueAs",
"(",
"ValueObjectInterface",
"$",
"dateTimeWithTimeZone",
")",
"{",
"if",
"(",
"false",
"===",
"Util",
"::",
"classEquals",
"(",
"$",
"this",
",",
"$",
"dateTimeWithTimeZone",
")",
")",
"{",
"return",
"false",
";",
"}",
"... | Tells whether two DateTimeWithTimeZone are equal by comparing their values
@param ValueObjectInterface $dateTimeWithTimeZone
@return bool | [
"Tells",
"whether",
"two",
"DateTimeWithTimeZone",
"are",
"equal",
"by",
"comparing",
"their",
"values"
] | 4554239ab75d65eeb9773219aa5b07e9fbfabb92 | https://github.com/cubicmushroom/valueobjects/blob/4554239ab75d65eeb9773219aa5b07e9fbfabb92/src/DateTime/DateTimeWithTimeZone.php#L83-L91 |
192,947 | cubicmushroom/valueobjects | src/DateTime/DateTimeWithTimeZone.php | DateTimeWithTimeZone.sameTimestampAs | public function sameTimestampAs(ValueObjectInterface $dateTimeWithTimeZone)
{
if (false === Util::classEquals($this, $dateTimeWithTimeZone)) {
return false;
}
return $this->toNativeDateTime() == $dateTimeWithTimeZone->toNativeDateTime();
} | php | public function sameTimestampAs(ValueObjectInterface $dateTimeWithTimeZone)
{
if (false === Util::classEquals($this, $dateTimeWithTimeZone)) {
return false;
}
return $this->toNativeDateTime() == $dateTimeWithTimeZone->toNativeDateTime();
} | [
"public",
"function",
"sameTimestampAs",
"(",
"ValueObjectInterface",
"$",
"dateTimeWithTimeZone",
")",
"{",
"if",
"(",
"false",
"===",
"Util",
"::",
"classEquals",
"(",
"$",
"this",
",",
"$",
"dateTimeWithTimeZone",
")",
")",
"{",
"return",
"false",
";",
"}",... | Tells whether two DateTimeWithTimeZone represents the same timestamp
@param ValueObjectInterface $dateTimeWithTimeZone
@return bool | [
"Tells",
"whether",
"two",
"DateTimeWithTimeZone",
"represents",
"the",
"same",
"timestamp"
] | 4554239ab75d65eeb9773219aa5b07e9fbfabb92 | https://github.com/cubicmushroom/valueobjects/blob/4554239ab75d65eeb9773219aa5b07e9fbfabb92/src/DateTime/DateTimeWithTimeZone.php#L100-L107 |
192,948 | cubicmushroom/valueobjects | src/DateTime/DateTimeWithTimeZone.php | DateTimeWithTimeZone.toNativeDateTime | public function toNativeDateTime()
{
$date = $this->getDateTime()->getDate();
$time = $this->getDateTime()->getTime();
$year = $date->getYear()->toNative();
$month = $date->getMonth()->getNumericValue();
$day = $date->getDay()->toNative();
$hour ... | php | public function toNativeDateTime()
{
$date = $this->getDateTime()->getDate();
$time = $this->getDateTime()->getTime();
$year = $date->getYear()->toNative();
$month = $date->getMonth()->getNumericValue();
$day = $date->getDay()->toNative();
$hour ... | [
"public",
"function",
"toNativeDateTime",
"(",
")",
"{",
"$",
"date",
"=",
"$",
"this",
"->",
"getDateTime",
"(",
")",
"->",
"getDate",
"(",
")",
";",
"$",
"time",
"=",
"$",
"this",
"->",
"getDateTime",
"(",
")",
"->",
"getTime",
"(",
")",
";",
"$"... | Returns a native PHP \DateTime version of the current DateTimeWithTimeZone
@return \DateTime | [
"Returns",
"a",
"native",
"PHP",
"\\",
"DateTime",
"version",
"of",
"the",
"current",
"DateTimeWithTimeZone"
] | 4554239ab75d65eeb9773219aa5b07e9fbfabb92 | https://github.com/cubicmushroom/valueobjects/blob/4554239ab75d65eeb9773219aa5b07e9fbfabb92/src/DateTime/DateTimeWithTimeZone.php#L134-L152 |
192,949 | seyfer/ZendPsrLogger | src/ZendPsrLogger/Logger.php | Logger.log | public function log($level, $message, array $context = [])
{
if (isset($this->psrToZendPriorityMap[$level])) {
$level = $this->psrToZendPriorityMap[$level];
}
$this->externalLogger
->log($level, $message, $this->getExtraWithContextMerged($context));
} | php | public function log($level, $message, array $context = [])
{
if (isset($this->psrToZendPriorityMap[$level])) {
$level = $this->psrToZendPriorityMap[$level];
}
$this->externalLogger
->log($level, $message, $this->getExtraWithContextMerged($context));
} | [
"public",
"function",
"log",
"(",
"$",
"level",
",",
"$",
"message",
",",
"array",
"$",
"context",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"psrToZendPriorityMap",
"[",
"$",
"level",
"]",
")",
")",
"{",
"$",
"level",
"... | main log function
@param $level
@param $message
@param array $context
@return null|void | [
"main",
"log",
"function"
] | aafd57012bbdc144083362cb7e621c9d7e13aabf | https://github.com/seyfer/ZendPsrLogger/blob/aafd57012bbdc144083362cb7e621c9d7e13aabf/src/ZendPsrLogger/Logger.php#L104-L113 |
192,950 | seyfer/ZendPsrLogger | src/ZendPsrLogger/Logger.php | Logger.getExtraWithContextMerged | private function getExtraWithContextMerged(array $context = [])
{
$extra = $this->getExtra();
if (!empty($context)) {
$extra = array_merge($extra, $context);
}
return $extra;
} | php | private function getExtraWithContextMerged(array $context = [])
{
$extra = $this->getExtra();
if (!empty($context)) {
$extra = array_merge($extra, $context);
}
return $extra;
} | [
"private",
"function",
"getExtraWithContextMerged",
"(",
"array",
"$",
"context",
"=",
"[",
"]",
")",
"{",
"$",
"extra",
"=",
"$",
"this",
"->",
"getExtra",
"(",
")",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"context",
")",
")",
"{",
"$",
"extra",
"... | merge extra with current context
@param array $context
@return array | [
"merge",
"extra",
"with",
"current",
"context"
] | aafd57012bbdc144083362cb7e621c9d7e13aabf | https://github.com/seyfer/ZendPsrLogger/blob/aafd57012bbdc144083362cb7e621c9d7e13aabf/src/ZendPsrLogger/Logger.php#L120-L128 |
192,951 | mwyatt/core | src/Helper.php | Helper.slugify | public static function slugify($slug)
{
$slug = preg_replace('/\xE3\x80\x80/', ' ', $slug);
$slug = str_replace('-', ' ', $slug);
$slug = preg_replace('#[:\#\*"@+=;!><&\.%()\]\/\'\\\\|\[]#', "\x20", $slug);
$slug = str_replace('?', '', $slug);
$slug = trim(mb_strtolower($slug... | php | public static function slugify($slug)
{
$slug = preg_replace('/\xE3\x80\x80/', ' ', $slug);
$slug = str_replace('-', ' ', $slug);
$slug = preg_replace('#[:\#\*"@+=;!><&\.%()\]\/\'\\\\|\[]#', "\x20", $slug);
$slug = str_replace('?', '', $slug);
$slug = trim(mb_strtolower($slug... | [
"public",
"static",
"function",
"slugify",
"(",
"$",
"slug",
")",
"{",
"$",
"slug",
"=",
"preg_replace",
"(",
"'/\\xE3\\x80\\x80/'",
",",
"' '",
",",
"$",
"slug",
")",
";",
"$",
"slug",
"=",
"str_replace",
"(",
"'-'",
",",
"' '",
",",
"$",
"slug",
")... | better than urlfriendly because & becomes 'amp' then when
making urls it can be translated?
@param string $slug
@return string foo-bar | [
"better",
"than",
"urlfriendly",
"because",
"&",
"becomes",
"amp",
"then",
"when",
"making",
"urls",
"it",
"can",
"be",
"translated?"
] | 8ea9d67cc84fe6aff17a469c703d5492dbcd93ed | https://github.com/mwyatt/core/blob/8ea9d67cc84fe6aff17a469c703d5492dbcd93ed/src/Helper.php#L67-L76 |
192,952 | mwyatt/core | src/Helper.php | Helper.calcAverage | public static function calcAverage($small, $big)
{
$average = 0;
if ($big != 0) {
$x = 0;
$y = 0;
$average = 0;
$x = $small / $big;
$y = $x * 100;
// $average = round($y); // converts to 65%
$average = number_format(... | php | public static function calcAverage($small, $big)
{
$average = 0;
if ($big != 0) {
$x = 0;
$y = 0;
$average = 0;
$x = $small / $big;
$y = $x * 100;
// $average = round($y); // converts to 65%
$average = number_format(... | [
"public",
"static",
"function",
"calcAverage",
"(",
"$",
"small",
",",
"$",
"big",
")",
"{",
"$",
"average",
"=",
"0",
";",
"if",
"(",
"$",
"big",
"!=",
"0",
")",
"{",
"$",
"x",
"=",
"0",
";",
"$",
"y",
"=",
"0",
";",
"$",
"average",
"=",
"... | calculates the average 0 to 100
@param int $small
@param int $big
@return int | [
"calculates",
"the",
"average",
"0",
"to",
"100"
] | 8ea9d67cc84fe6aff17a469c703d5492dbcd93ed | https://github.com/mwyatt/core/blob/8ea9d67cc84fe6aff17a469c703d5492dbcd93ed/src/Helper.php#L96-L109 |
192,953 | gplcart/device | controllers/Settings.php | Settings.getFrontendThemesSettings | protected function getFrontendThemesSettings()
{
$themes = $this->module->getByType('theme', true);
unset($themes[$this->theme_backend]);
return $themes;
} | php | protected function getFrontendThemesSettings()
{
$themes = $this->module->getByType('theme', true);
unset($themes[$this->theme_backend]);
return $themes;
} | [
"protected",
"function",
"getFrontendThemesSettings",
"(",
")",
"{",
"$",
"themes",
"=",
"$",
"this",
"->",
"module",
"->",
"getByType",
"(",
"'theme'",
",",
"true",
")",
";",
"unset",
"(",
"$",
"themes",
"[",
"$",
"this",
"->",
"theme_backend",
"]",
")"... | Returns an array of frontend themes | [
"Returns",
"an",
"array",
"of",
"frontend",
"themes"
] | 288fcbd50cc3a2c7aa74cc0c3410135dcc9b2881 | https://github.com/gplcart/device/blob/288fcbd50cc3a2c7aa74cc0c3410135dcc9b2881/controllers/Settings.php#L39-L44 |
192,954 | Wedeto/Log | src/LoggerFactory.php | LoggerFactory.getLogger | public static function getLogger(array $context = array())
{
$str = \Wedeto\Util\Functions::str($context);
if (self::$logger_factory === null)
return new NullLogger();
return self::$logger_factory->get(array($context['class'] ?? "Wedeto.UndefinedLogger"));
} | php | public static function getLogger(array $context = array())
{
$str = \Wedeto\Util\Functions::str($context);
if (self::$logger_factory === null)
return new NullLogger();
return self::$logger_factory->get(array($context['class'] ?? "Wedeto.UndefinedLogger"));
} | [
"public",
"static",
"function",
"getLogger",
"(",
"array",
"$",
"context",
"=",
"array",
"(",
")",
")",
"{",
"$",
"str",
"=",
"\\",
"Wedeto",
"\\",
"Util",
"\\",
"Functions",
"::",
"str",
"(",
"$",
"context",
")",
";",
"if",
"(",
"self",
"::",
"$",... | This function is subscribed to the Wedeto.Util.GetLogger hook to obtain their logger. | [
"This",
"function",
"is",
"subscribed",
"to",
"the",
"Wedeto",
".",
"Util",
".",
"GetLogger",
"hook",
"to",
"obtain",
"their",
"logger",
"."
] | 88252c5052089fdcc5dae466d1ad5889bb2b735f | https://github.com/Wedeto/Log/blob/88252c5052089fdcc5dae466d1ad5889bb2b735f/src/LoggerFactory.php#L50-L57 |
192,955 | Wedeto/HTTP | src/Response/Error.php | Error.getResponse | public function getResponse()
{
if (empty($this->response))
$this->response = new StringResponse(WF::str($this->getPrevious() ?? $this), "text/plain");
return $this->response;
} | php | public function getResponse()
{
if (empty($this->response))
$this->response = new StringResponse(WF::str($this->getPrevious() ?? $this), "text/plain");
return $this->response;
} | [
"public",
"function",
"getResponse",
"(",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"response",
")",
")",
"$",
"this",
"->",
"response",
"=",
"new",
"StringResponse",
"(",
"WF",
"::",
"str",
"(",
"$",
"this",
"->",
"getPrevious",
"(",
")"... | Get the formatted response, representing this error | [
"Get",
"the",
"formatted",
"response",
"representing",
"this",
"error"
] | 7318eff1b81a3c103c4263466d09b7f3593b70b9 | https://github.com/Wedeto/HTTP/blob/7318eff1b81a3c103c4263466d09b7f3593b70b9/src/Response/Error.php#L68-L74 |
192,956 | jfadich/json-property | src/JsonManager.php | JsonManager.getJsonProperty | public function getJsonProperty($property, $key = null, $default = null)
{
$instance = $this->getJsonInstance($property);
if ( $key !== null ) {
return $instance->get( $key, $default );
}
return $instance;
} | php | public function getJsonProperty($property, $key = null, $default = null)
{
$instance = $this->getJsonInstance($property);
if ( $key !== null ) {
return $instance->get( $key, $default );
}
return $instance;
} | [
"public",
"function",
"getJsonProperty",
"(",
"$",
"property",
",",
"$",
"key",
"=",
"null",
",",
"$",
"default",
"=",
"null",
")",
"{",
"$",
"instance",
"=",
"$",
"this",
"->",
"getJsonInstance",
"(",
"$",
"property",
")",
";",
"if",
"(",
"$",
"key"... | Get instance for given property. If a key is given return the value or default.
@param $property
@param string $key
@param mixed $default
@return JsonProperty
@throws JsonPropertyException | [
"Get",
"instance",
"for",
"given",
"property",
".",
"If",
"a",
"key",
"is",
"given",
"return",
"the",
"value",
"or",
"default",
"."
] | 3c11ac731a7bc206529058a94047eeafa5827b15 | https://github.com/jfadich/json-property/blob/3c11ac731a7bc206529058a94047eeafa5827b15/src/JsonManager.php#L58-L67 |
192,957 | jfadich/json-property | src/JsonManager.php | JsonManager.isJsonProperty | public function isJsonProperty($property, $throwException = false)
{
if(is_string($property) && in_array($property, $this->properties))
return true;
if($throwException)
throw new JsonPropertyException("Requested property '{$property}' is not a valid for '".get_class($this)."... | php | public function isJsonProperty($property, $throwException = false)
{
if(is_string($property) && in_array($property, $this->properties))
return true;
if($throwException)
throw new JsonPropertyException("Requested property '{$property}' is not a valid for '".get_class($this)."... | [
"public",
"function",
"isJsonProperty",
"(",
"$",
"property",
",",
"$",
"throwException",
"=",
"false",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"property",
")",
"&&",
"in_array",
"(",
"$",
"property",
",",
"$",
"this",
"->",
"properties",
")",
")",
... | Check if requested property is bound to the model
@param string $property
@param bool $throwException
@return bool
@throws JsonPropertyException | [
"Check",
"if",
"requested",
"property",
"is",
"bound",
"to",
"the",
"model"
] | 3c11ac731a7bc206529058a94047eeafa5827b15 | https://github.com/jfadich/json-property/blob/3c11ac731a7bc206529058a94047eeafa5827b15/src/JsonManager.php#L77-L86 |
192,958 | jfadich/json-property | src/JsonManager.php | JsonManager.getJsonInstance | private function getJsonInstance($property)
{
if(!$this->isJsonProperty($property))
throw new JsonPropertyException("Requested property '{$property}' is not a valid for '".get_class($this->model)."'.");
if(!array_key_exists($property, $this->jsonInstances))
$this->jsonInstan... | php | private function getJsonInstance($property)
{
if(!$this->isJsonProperty($property))
throw new JsonPropertyException("Requested property '{$property}' is not a valid for '".get_class($this->model)."'.");
if(!array_key_exists($property, $this->jsonInstances))
$this->jsonInstan... | [
"private",
"function",
"getJsonInstance",
"(",
"$",
"property",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"isJsonProperty",
"(",
"$",
"property",
")",
")",
"throw",
"new",
"JsonPropertyException",
"(",
"\"Requested property '{$property}' is not a valid for '\"",
... | Instantiate the JsonProperty object, or return the existing instance
@param string $property
@return JsonProperty
@throws JsonPropertyException | [
"Instantiate",
"the",
"JsonProperty",
"object",
"or",
"return",
"the",
"existing",
"instance"
] | 3c11ac731a7bc206529058a94047eeafa5827b15 | https://github.com/jfadich/json-property/blob/3c11ac731a7bc206529058a94047eeafa5827b15/src/JsonManager.php#L95-L104 |
192,959 | ekyna/MediaBundle | Controller/Admin/BrowserController.php | BrowserController.buildConfig | private function buildConfig(Request $request)
{
$config = array(
'mode' => $request->query->get('mode', 'browse'),
);
if (null !== $types = $request->query->get('types', array())) {
// TODO validate types
$config['types'] = $types;
}
retur... | php | private function buildConfig(Request $request)
{
$config = array(
'mode' => $request->query->get('mode', 'browse'),
);
if (null !== $types = $request->query->get('types', array())) {
// TODO validate types
$config['types'] = $types;
}
retur... | [
"private",
"function",
"buildConfig",
"(",
"Request",
"$",
"request",
")",
"{",
"$",
"config",
"=",
"array",
"(",
"'mode'",
"=>",
"$",
"request",
"->",
"query",
"->",
"get",
"(",
"'mode'",
",",
"'browse'",
")",
",",
")",
";",
"if",
"(",
"null",
"!=="... | Builds the browser config.
@param Request $request
@return array | [
"Builds",
"the",
"browser",
"config",
"."
] | 512cf86c801a130a9f17eba8b48d646d23acdbab | https://github.com/ekyna/MediaBundle/blob/512cf86c801a130a9f17eba8b48d646d23acdbab/Controller/Admin/BrowserController.php#L86-L96 |
192,960 | ekyna/MediaBundle | Controller/Admin/BrowserController.php | BrowserController.listAction | public function listAction(Request $request)
{
if (!$request->isXmlHttpRequest()) {
throw new NotFoundHttpException();
}
$root = $this->getFolderRepository()->findRoot();
if (null !== $id = $request->query->get('folderId')) {
if (!$this->activateFolderById($i... | php | public function listAction(Request $request)
{
if (!$request->isXmlHttpRequest()) {
throw new NotFoundHttpException();
}
$root = $this->getFolderRepository()->findRoot();
if (null !== $id = $request->query->get('folderId')) {
if (!$this->activateFolderById($i... | [
"public",
"function",
"listAction",
"(",
"Request",
"$",
"request",
")",
"{",
"if",
"(",
"!",
"$",
"request",
"->",
"isXmlHttpRequest",
"(",
")",
")",
"{",
"throw",
"new",
"NotFoundHttpException",
"(",
")",
";",
"}",
"$",
"root",
"=",
"$",
"this",
"->"... | Lists the children folders.
@param Request $request
@return Response | [
"Lists",
"the",
"children",
"folders",
"."
] | 512cf86c801a130a9f17eba8b48d646d23acdbab | https://github.com/ekyna/MediaBundle/blob/512cf86c801a130a9f17eba8b48d646d23acdbab/Controller/Admin/BrowserController.php#L105-L130 |
192,961 | ekyna/MediaBundle | Controller/Admin/BrowserController.php | BrowserController.activateFolderById | private function activateFolderById($id, FolderInterface $folder)
{
foreach ($folder->getChildren() as $child) {
if ($child->getId() == $id) {
$child->setActive(true);
return true;
}
if ($this->activateFolderById($id, $child)) {
... | php | private function activateFolderById($id, FolderInterface $folder)
{
foreach ($folder->getChildren() as $child) {
if ($child->getId() == $id) {
$child->setActive(true);
return true;
}
if ($this->activateFolderById($id, $child)) {
... | [
"private",
"function",
"activateFolderById",
"(",
"$",
"id",
",",
"FolderInterface",
"$",
"folder",
")",
"{",
"foreach",
"(",
"$",
"folder",
"->",
"getChildren",
"(",
")",
"as",
"$",
"child",
")",
"{",
"if",
"(",
"$",
"child",
"->",
"getId",
"(",
")",
... | Activate the folder by id.
@param int $id
@param FolderInterface $folder
@return bool | [
"Activate",
"the",
"folder",
"by",
"id",
"."
] | 512cf86c801a130a9f17eba8b48d646d23acdbab | https://github.com/ekyna/MediaBundle/blob/512cf86c801a130a9f17eba8b48d646d23acdbab/Controller/Admin/BrowserController.php#L140-L152 |
192,962 | ekyna/MediaBundle | Controller/Admin/BrowserController.php | BrowserController.createAction | public function createAction(Request $request)
{
if (!$request->isXmlHttpRequest()) {
throw new NotFoundHttpException();
}
$refFolder = $this->findFolderById($request->attributes->get('id'));
$repo = $this->getFolderRepository();
$newFolder = $repo->createNew();... | php | public function createAction(Request $request)
{
if (!$request->isXmlHttpRequest()) {
throw new NotFoundHttpException();
}
$refFolder = $this->findFolderById($request->attributes->get('id'));
$repo = $this->getFolderRepository();
$newFolder = $repo->createNew();... | [
"public",
"function",
"createAction",
"(",
"Request",
"$",
"request",
")",
"{",
"if",
"(",
"!",
"$",
"request",
"->",
"isXmlHttpRequest",
"(",
")",
")",
"{",
"throw",
"new",
"NotFoundHttpException",
"(",
")",
";",
"}",
"$",
"refFolder",
"=",
"$",
"this",... | Creates the folder.
@param Request $request
@return Response | [
"Creates",
"the",
"folder",
"."
] | 512cf86c801a130a9f17eba8b48d646d23acdbab | https://github.com/ekyna/MediaBundle/blob/512cf86c801a130a9f17eba8b48d646d23acdbab/Controller/Admin/BrowserController.php#L161-L204 |
192,963 | ekyna/MediaBundle | Controller/Admin/BrowserController.php | BrowserController.renameAction | public function renameAction(Request $request)
{
if (!$request->isXmlHttpRequest()) {
throw new NotFoundHttpException();
}
$folder = $this->findFolderById($request->attributes->get('id'));
$folder->setName($request->request->get('name'));
if (true !== $message ... | php | public function renameAction(Request $request)
{
if (!$request->isXmlHttpRequest()) {
throw new NotFoundHttpException();
}
$folder = $this->findFolderById($request->attributes->get('id'));
$folder->setName($request->request->get('name'));
if (true !== $message ... | [
"public",
"function",
"renameAction",
"(",
"Request",
"$",
"request",
")",
"{",
"if",
"(",
"!",
"$",
"request",
"->",
"isXmlHttpRequest",
"(",
")",
")",
"{",
"throw",
"new",
"NotFoundHttpException",
"(",
")",
";",
"}",
"$",
"folder",
"=",
"$",
"this",
... | Renames the folder.
@param Request $request
@return Response | [
"Renames",
"the",
"folder",
"."
] | 512cf86c801a130a9f17eba8b48d646d23acdbab | https://github.com/ekyna/MediaBundle/blob/512cf86c801a130a9f17eba8b48d646d23acdbab/Controller/Admin/BrowserController.php#L213-L238 |
192,964 | ekyna/MediaBundle | Controller/Admin/BrowserController.php | BrowserController.deleteAction | public function deleteAction(Request $request)
{
if (!$request->isXmlHttpRequest()) {
throw new NotFoundHttpException();
}
$folder = $this->findFolderById($request->attributes->get('id'));
$result = array();
try {
$this->removeFolder($folder);
... | php | public function deleteAction(Request $request)
{
if (!$request->isXmlHttpRequest()) {
throw new NotFoundHttpException();
}
$folder = $this->findFolderById($request->attributes->get('id'));
$result = array();
try {
$this->removeFolder($folder);
... | [
"public",
"function",
"deleteAction",
"(",
"Request",
"$",
"request",
")",
"{",
"if",
"(",
"!",
"$",
"request",
"->",
"isXmlHttpRequest",
"(",
")",
")",
"{",
"throw",
"new",
"NotFoundHttpException",
"(",
")",
";",
"}",
"$",
"folder",
"=",
"$",
"this",
... | Deletes the folder.
@param Request $request
@return Response | [
"Deletes",
"the",
"folder",
"."
] | 512cf86c801a130a9f17eba8b48d646d23acdbab | https://github.com/ekyna/MediaBundle/blob/512cf86c801a130a9f17eba8b48d646d23acdbab/Controller/Admin/BrowserController.php#L247-L268 |
192,965 | ekyna/MediaBundle | Controller/Admin/BrowserController.php | BrowserController.moveAction | public function moveAction(Request $request)
{
if (!$request->isXmlHttpRequest()) {
throw new NotFoundHttpException();
}
$folder = $this->findFolderById($request->attributes->get('id'));
$result = [];
$mode = $request->request->get('mode');
if (!in_arra... | php | public function moveAction(Request $request)
{
if (!$request->isXmlHttpRequest()) {
throw new NotFoundHttpException();
}
$folder = $this->findFolderById($request->attributes->get('id'));
$result = [];
$mode = $request->request->get('mode');
if (!in_arra... | [
"public",
"function",
"moveAction",
"(",
"Request",
"$",
"request",
")",
"{",
"if",
"(",
"!",
"$",
"request",
"->",
"isXmlHttpRequest",
"(",
")",
")",
"{",
"throw",
"new",
"NotFoundHttpException",
"(",
")",
";",
"}",
"$",
"folder",
"=",
"$",
"this",
"-... | Moves the folder.
@param Request $request
@return Response | [
"Moves",
"the",
"folder",
"."
] | 512cf86c801a130a9f17eba8b48d646d23acdbab | https://github.com/ekyna/MediaBundle/blob/512cf86c801a130a9f17eba8b48d646d23acdbab/Controller/Admin/BrowserController.php#L277-L309 |
192,966 | ekyna/MediaBundle | Controller/Admin/BrowserController.php | BrowserController.listMediaAction | public function listMediaAction(Request $request)
{
if (!$request->isXmlHttpRequest()) {
throw new NotFoundHttpException();
}
$folder = $this->findFolderById($request->attributes->get('id'));
$medias = $this
->get('ekyna_media.browser')
->setFold... | php | public function listMediaAction(Request $request)
{
if (!$request->isXmlHttpRequest()) {
throw new NotFoundHttpException();
}
$folder = $this->findFolderById($request->attributes->get('id'));
$medias = $this
->get('ekyna_media.browser')
->setFold... | [
"public",
"function",
"listMediaAction",
"(",
"Request",
"$",
"request",
")",
"{",
"if",
"(",
"!",
"$",
"request",
"->",
"isXmlHttpRequest",
"(",
")",
")",
"{",
"throw",
"new",
"NotFoundHttpException",
"(",
")",
";",
"}",
"$",
"folder",
"=",
"$",
"this",... | Lists the medias by folder.
@param Request $request
@return Response | [
"Lists",
"the",
"medias",
"by",
"folder",
"."
] | 512cf86c801a130a9f17eba8b48d646d23acdbab | https://github.com/ekyna/MediaBundle/blob/512cf86c801a130a9f17eba8b48d646d23acdbab/Controller/Admin/BrowserController.php#L318-L341 |
192,967 | ekyna/MediaBundle | Controller/Admin/BrowserController.php | BrowserController.moveMediaAction | public function moveMediaAction(Request $request)
{
if (!$request->isXmlHttpRequest()) {
throw new NotFoundHttpException();
}
$folder = $this->findFolderById($request->attributes->get('id'));
/** @var \Ekyna\Bundle\MediaBundle\Model\MediaInterface $media */
$med... | php | public function moveMediaAction(Request $request)
{
if (!$request->isXmlHttpRequest()) {
throw new NotFoundHttpException();
}
$folder = $this->findFolderById($request->attributes->get('id'));
/** @var \Ekyna\Bundle\MediaBundle\Model\MediaInterface $media */
$med... | [
"public",
"function",
"moveMediaAction",
"(",
"Request",
"$",
"request",
")",
"{",
"if",
"(",
"!",
"$",
"request",
"->",
"isXmlHttpRequest",
"(",
")",
")",
"{",
"throw",
"new",
"NotFoundHttpException",
"(",
")",
";",
"}",
"$",
"folder",
"=",
"$",
"this",... | Moves the media to the folder.
@param Request $request
@return Response | [
"Moves",
"the",
"media",
"to",
"the",
"folder",
"."
] | 512cf86c801a130a9f17eba8b48d646d23acdbab | https://github.com/ekyna/MediaBundle/blob/512cf86c801a130a9f17eba8b48d646d23acdbab/Controller/Admin/BrowserController.php#L350-L379 |
192,968 | ekyna/MediaBundle | Controller/Admin/BrowserController.php | BrowserController.createMediaAction | public function createMediaAction(Request $request)
{
if (!$request->isXmlHttpRequest()) {
throw new NotFoundHttpException();
}
$folderId = $request->attributes->get('id');
$folder = $this->findFolderById($folderId);
$upload = new MediaUpload();
$form =... | php | public function createMediaAction(Request $request)
{
if (!$request->isXmlHttpRequest()) {
throw new NotFoundHttpException();
}
$folderId = $request->attributes->get('id');
$folder = $this->findFolderById($folderId);
$upload = new MediaUpload();
$form =... | [
"public",
"function",
"createMediaAction",
"(",
"Request",
"$",
"request",
")",
"{",
"if",
"(",
"!",
"$",
"request",
"->",
"isXmlHttpRequest",
"(",
")",
")",
"{",
"throw",
"new",
"NotFoundHttpException",
"(",
")",
";",
"}",
"$",
"folderId",
"=",
"$",
"re... | Creates the media into the folder.
@param Request $request
@return Response | [
"Creates",
"the",
"media",
"into",
"the",
"folder",
"."
] | 512cf86c801a130a9f17eba8b48d646d23acdbab | https://github.com/ekyna/MediaBundle/blob/512cf86c801a130a9f17eba8b48d646d23acdbab/Controller/Admin/BrowserController.php#L388-L437 |
192,969 | ekyna/MediaBundle | Controller/Admin/BrowserController.php | BrowserController.importMediaAction | public function importMediaAction(Request $request)
{
if (!$request->isXmlHttpRequest()) {
throw new NotFoundHttpException();
}
$modal = $this->createModal();
$modal->setTitle('ekyna_media.import.title');
$folderId = $request->attributes->get('id');
$fol... | php | public function importMediaAction(Request $request)
{
if (!$request->isXmlHttpRequest()) {
throw new NotFoundHttpException();
}
$modal = $this->createModal();
$modal->setTitle('ekyna_media.import.title');
$folderId = $request->attributes->get('id');
$fol... | [
"public",
"function",
"importMediaAction",
"(",
"Request",
"$",
"request",
")",
"{",
"if",
"(",
"!",
"$",
"request",
"->",
"isXmlHttpRequest",
"(",
")",
")",
"{",
"throw",
"new",
"NotFoundHttpException",
"(",
")",
";",
"}",
"$",
"modal",
"=",
"$",
"this"... | Imports the media into the folder.
@param Request $request
@return Response | [
"Imports",
"the",
"media",
"into",
"the",
"folder",
"."
] | 512cf86c801a130a9f17eba8b48d646d23acdbab | https://github.com/ekyna/MediaBundle/blob/512cf86c801a130a9f17eba8b48d646d23acdbab/Controller/Admin/BrowserController.php#L446-L487 |
192,970 | ekyna/MediaBundle | Controller/Admin/BrowserController.php | BrowserController.persistFolder | private function persistFolder(FolderInterface $folder)
{
$em = $this->getEntityManager();
$em->persist($folder);
$em->flush();
} | php | private function persistFolder(FolderInterface $folder)
{
$em = $this->getEntityManager();
$em->persist($folder);
$em->flush();
} | [
"private",
"function",
"persistFolder",
"(",
"FolderInterface",
"$",
"folder",
")",
"{",
"$",
"em",
"=",
"$",
"this",
"->",
"getEntityManager",
"(",
")",
";",
"$",
"em",
"->",
"persist",
"(",
"$",
"folder",
")",
";",
"$",
"em",
"->",
"flush",
"(",
")... | Persists the folder.
@param FolderInterface $folder | [
"Persists",
"the",
"folder",
"."
] | 512cf86c801a130a9f17eba8b48d646d23acdbab | https://github.com/ekyna/MediaBundle/blob/512cf86c801a130a9f17eba8b48d646d23acdbab/Controller/Admin/BrowserController.php#L524-L529 |
192,971 | ekyna/MediaBundle | Controller/Admin/BrowserController.php | BrowserController.removeFolder | private function removeFolder(FolderInterface $folder)
{
$em = $this->getEntityManager();
$em->remove($folder);
$em->flush();
} | php | private function removeFolder(FolderInterface $folder)
{
$em = $this->getEntityManager();
$em->remove($folder);
$em->flush();
} | [
"private",
"function",
"removeFolder",
"(",
"FolderInterface",
"$",
"folder",
")",
"{",
"$",
"em",
"=",
"$",
"this",
"->",
"getEntityManager",
"(",
")",
";",
"$",
"em",
"->",
"remove",
"(",
"$",
"folder",
")",
";",
"$",
"em",
"->",
"flush",
"(",
")",... | Removes the folder.
@param FolderInterface $folder | [
"Removes",
"the",
"folder",
"."
] | 512cf86c801a130a9f17eba8b48d646d23acdbab | https://github.com/ekyna/MediaBundle/blob/512cf86c801a130a9f17eba8b48d646d23acdbab/Controller/Admin/BrowserController.php#L536-L541 |
192,972 | ekyna/MediaBundle | Controller/Admin/BrowserController.php | BrowserController.validateFolder | private function validateFolder(FolderInterface $folder)
{
$errorList = $this->get('validator')->validate($folder);
if ($errorList->count()) {
return $errorList->get(0)->getMessage();
}
return true;
} | php | private function validateFolder(FolderInterface $folder)
{
$errorList = $this->get('validator')->validate($folder);
if ($errorList->count()) {
return $errorList->get(0)->getMessage();
}
return true;
} | [
"private",
"function",
"validateFolder",
"(",
"FolderInterface",
"$",
"folder",
")",
"{",
"$",
"errorList",
"=",
"$",
"this",
"->",
"get",
"(",
"'validator'",
")",
"->",
"validate",
"(",
"$",
"folder",
")",
";",
"if",
"(",
"$",
"errorList",
"->",
"count"... | Validates the folder.
@param FolderInterface $folder
@return true|string | [
"Validates",
"the",
"folder",
"."
] | 512cf86c801a130a9f17eba8b48d646d23acdbab | https://github.com/ekyna/MediaBundle/blob/512cf86c801a130a9f17eba8b48d646d23acdbab/Controller/Admin/BrowserController.php#L560-L567 |
192,973 | ekyna/MediaBundle | Controller/Admin/BrowserController.php | BrowserController.findFolderById | private function findFolderById($id)
{
$folder = $this->getFolderRepository()->find($id);
if (null === $folder) {
throw new NotFoundHttpException('Folder not found.');
}
return $folder;
} | php | private function findFolderById($id)
{
$folder = $this->getFolderRepository()->find($id);
if (null === $folder) {
throw new NotFoundHttpException('Folder not found.');
}
return $folder;
} | [
"private",
"function",
"findFolderById",
"(",
"$",
"id",
")",
"{",
"$",
"folder",
"=",
"$",
"this",
"->",
"getFolderRepository",
"(",
")",
"->",
"find",
"(",
"$",
"id",
")",
";",
"if",
"(",
"null",
"===",
"$",
"folder",
")",
"{",
"throw",
"new",
"N... | Returns the folder by id.
@param integer $id
@return FolderInterface | [
"Returns",
"the",
"folder",
"by",
"id",
"."
] | 512cf86c801a130a9f17eba8b48d646d23acdbab | https://github.com/ekyna/MediaBundle/blob/512cf86c801a130a9f17eba8b48d646d23acdbab/Controller/Admin/BrowserController.php#L576-L583 |
192,974 | praxigento/mobi_mod_pv | Service/Sale/Save.php | Save.exec | public function exec(ARequest $request)
{
$result = new AResponse();
$orderId = $request->getSaleOrderId();
$datePaid = $request->getSaleOrderDatePaid();
$items = $request->getOrderItems();
/* for all items get PV data by warehouse */
$orderTotal = 0;
foreach ... | php | public function exec(ARequest $request)
{
$result = new AResponse();
$orderId = $request->getSaleOrderId();
$datePaid = $request->getSaleOrderDatePaid();
$items = $request->getOrderItems();
/* for all items get PV data by warehouse */
$orderTotal = 0;
foreach ... | [
"public",
"function",
"exec",
"(",
"ARequest",
"$",
"request",
")",
"{",
"$",
"result",
"=",
"new",
"AResponse",
"(",
")",
";",
"$",
"orderId",
"=",
"$",
"request",
"->",
"getSaleOrderId",
"(",
")",
";",
"$",
"datePaid",
"=",
"$",
"request",
"->",
"g... | Save PV data on sale order save.
@param ARequest $request
@return AResponse | [
"Save",
"PV",
"data",
"on",
"sale",
"order",
"save",
"."
] | d1540b7e94264527006e8b9fa68904a72a63928e | https://github.com/praxigento/mobi_mod_pv/blob/d1540b7e94264527006e8b9fa68904a72a63928e/Service/Sale/Save.php#L36-L70 |
192,975 | smalldb/smalldb-rest | class/Application.php | Application.createSmalldb | public static function createSmalldb($config)
{
// Create Smalldb backend without context
$smalldb = new \Smalldb\StateMachine\JsonDirBackend($config['smalldb'], null, 'smalldb');
// Initialize database connection & query builder
$flupdo = \Smalldb\Flupdo\Flupdo::createInstanceFromConfig($config['flupdo']);
... | php | public static function createSmalldb($config)
{
// Create Smalldb backend without context
$smalldb = new \Smalldb\StateMachine\JsonDirBackend($config['smalldb'], null, 'smalldb');
// Initialize database connection & query builder
$flupdo = \Smalldb\Flupdo\Flupdo::createInstanceFromConfig($config['flupdo']);
... | [
"public",
"static",
"function",
"createSmalldb",
"(",
"$",
"config",
")",
"{",
"// Create Smalldb backend without context",
"$",
"smalldb",
"=",
"new",
"\\",
"Smalldb",
"\\",
"StateMachine",
"\\",
"JsonDirBackend",
"(",
"$",
"config",
"[",
"'smalldb'",
"]",
",",
... | Create and initialize Smalldb, including Flupdo and Auth objects | [
"Create",
"and",
"initialize",
"Smalldb",
"including",
"Flupdo",
"and",
"Auth",
"objects"
] | ff393ee39060b4524d41835921e86ed40af006fe | https://github.com/smalldb/smalldb-rest/blob/ff393ee39060b4524d41835921e86ed40af006fe/class/Application.php#L136-L161 |
192,976 | smalldb/smalldb-rest | class/Application.php | Application.renderStateMachine | public static function renderStateMachine(\Smalldb\StateMachine\AbstractBackend $smalldb, $machine, $format)
{
$dot = $smalldb->getMachine($machine)->exportDot();
if ($format == 'dot') {
header('Content-Type: text/plain; encoding=utf8');
echo $dot;
} else if ($format == 'png' || $format == 'pdf' || $forma... | php | public static function renderStateMachine(\Smalldb\StateMachine\AbstractBackend $smalldb, $machine, $format)
{
$dot = $smalldb->getMachine($machine)->exportDot();
if ($format == 'dot') {
header('Content-Type: text/plain; encoding=utf8');
echo $dot;
} else if ($format == 'png' || $format == 'pdf' || $forma... | [
"public",
"static",
"function",
"renderStateMachine",
"(",
"\\",
"Smalldb",
"\\",
"StateMachine",
"\\",
"AbstractBackend",
"$",
"smalldb",
",",
"$",
"machine",
",",
"$",
"format",
")",
"{",
"$",
"dot",
"=",
"$",
"smalldb",
"->",
"getMachine",
"(",
"$",
"ma... | Render state diagram | [
"Render",
"state",
"diagram"
] | ff393ee39060b4524d41835921e86ed40af006fe | https://github.com/smalldb/smalldb-rest/blob/ff393ee39060b4524d41835921e86ed40af006fe/class/Application.php#L186-L234 |
192,977 | lightwerk/SurfTasks | Classes/Lightwerk/SurfTasks/Task/Database/AbstractTask.php | AbstractTask.getMysqlArguments | protected function getMysqlArguments($credentials, $appendDatabase = true)
{
$arguments = [];
$database = '';
foreach ($this->databaseArguments as $key) {
if (empty($credentials[$key])) {
continue;
}
$value = escapeshellarg($credentials[$ke... | php | protected function getMysqlArguments($credentials, $appendDatabase = true)
{
$arguments = [];
$database = '';
foreach ($this->databaseArguments as $key) {
if (empty($credentials[$key])) {
continue;
}
$value = escapeshellarg($credentials[$ke... | [
"protected",
"function",
"getMysqlArguments",
"(",
"$",
"credentials",
",",
"$",
"appendDatabase",
"=",
"true",
")",
"{",
"$",
"arguments",
"=",
"[",
"]",
";",
"$",
"database",
"=",
"''",
";",
"foreach",
"(",
"$",
"this",
"->",
"databaseArguments",
"as",
... | Returns MySQL Arguments.
@param array $credentials
@param bool $appendDatabase
@return string | [
"Returns",
"MySQL",
"Arguments",
"."
] | 8a6e4c85e42c762ad6515778c3fc7e19052cd9d1 | https://github.com/lightwerk/SurfTasks/blob/8a6e4c85e42c762ad6515778c3fc7e19052cd9d1/Classes/Lightwerk/SurfTasks/Task/Database/AbstractTask.php#L158-L178 |
192,978 | sndsgd/sndsgd-event | src/Event.php | Event.split | public static function split($event)
{
if (!is_string($event)) {
throw new InvalidArgumentException(
"invalid value provided for 'event'; expecting an event name ".
"or event name and namespace as string"
);
}
list($type, $namespace) = array_pad(explode('.... | php | public static function split($event)
{
if (!is_string($event)) {
throw new InvalidArgumentException(
"invalid value provided for 'event'; expecting an event name ".
"or event name and namespace as string"
);
}
list($type, $namespace) = array_pad(explode('.... | [
"public",
"static",
"function",
"split",
"(",
"$",
"event",
")",
"{",
"if",
"(",
"!",
"is_string",
"(",
"$",
"event",
")",
")",
"{",
"throw",
"new",
"InvalidArgumentException",
"(",
"\"invalid value provided for 'event'; expecting an event name \"",
".",
"\"or event... | Split an event in the type and namespace portions
@param string $event The type/namespace combo for an event
@return array.<string|null> | [
"Split",
"an",
"event",
"in",
"the",
"type",
"and",
"namespace",
"portions"
] | 531bd348fd77db6a27346aa6dfec43e99ecd3eef | https://github.com/sndsgd/sndsgd-event/blob/531bd348fd77db6a27346aa6dfec43e99ecd3eef/src/Event.php#L24-L38 |
192,979 | dms-org/common.structure | src/Table/Form/Builder/TableColumnFieldDefiner.php | TableColumnFieldDefiner.withPredefinedColumnValues | public function withPredefinedColumnValues(FieldBuilderBase $field, array $columnValues) : TableRowFieldDefiner
{
$this->fieldBuilder->attr(TableType::ATTR_PREDEFINED_COLUMNS, array_values($columnValues));
return $this->withColumnKeyAs($field);
} | php | public function withPredefinedColumnValues(FieldBuilderBase $field, array $columnValues) : TableRowFieldDefiner
{
$this->fieldBuilder->attr(TableType::ATTR_PREDEFINED_COLUMNS, array_values($columnValues));
return $this->withColumnKeyAs($field);
} | [
"public",
"function",
"withPredefinedColumnValues",
"(",
"FieldBuilderBase",
"$",
"field",
",",
"array",
"$",
"columnValues",
")",
":",
"TableRowFieldDefiner",
"{",
"$",
"this",
"->",
"fieldBuilder",
"->",
"attr",
"(",
"TableType",
"::",
"ATTR_PREDEFINED_COLUMNS",
"... | Defines the columns as predefined set of values.
@param FieldBuilderBase $field
@param array $columnValues
@return TableRowFieldDefiner | [
"Defines",
"the",
"columns",
"as",
"predefined",
"set",
"of",
"values",
"."
] | 23f122182f60df5ec847047a81a39c8aab019ff1 | https://github.com/dms-org/common.structure/blob/23f122182f60df5ec847047a81a39c8aab019ff1/src/Table/Form/Builder/TableColumnFieldDefiner.php#L46-L50 |
192,980 | dms-org/common.structure | src/Table/Form/Builder/TableColumnFieldDefiner.php | TableColumnFieldDefiner.withColumnKeyAsField | public function withColumnKeyAsField(IField $field) : TableRowFieldDefiner
{
return new TableRowFieldDefiner($this->fieldBuilder, $this->cellClassName, $field);
} | php | public function withColumnKeyAsField(IField $field) : TableRowFieldDefiner
{
return new TableRowFieldDefiner($this->fieldBuilder, $this->cellClassName, $field);
} | [
"public",
"function",
"withColumnKeyAsField",
"(",
"IField",
"$",
"field",
")",
":",
"TableRowFieldDefiner",
"{",
"return",
"new",
"TableRowFieldDefiner",
"(",
"$",
"this",
"->",
"fieldBuilder",
",",
"$",
"this",
"->",
"cellClassName",
",",
"$",
"field",
")",
... | Defines the column field for the table.
@param IField $field
@return TableRowFieldDefiner | [
"Defines",
"the",
"column",
"field",
"for",
"the",
"table",
"."
] | 23f122182f60df5ec847047a81a39c8aab019ff1 | https://github.com/dms-org/common.structure/blob/23f122182f60df5ec847047a81a39c8aab019ff1/src/Table/Form/Builder/TableColumnFieldDefiner.php#L71-L74 |
192,981 | comodojo/foundation | src/Comodojo/Foundation/Utils/ArrayOps.php | ArrayOps.circularDiffKeys | public static function circularDiffKeys(array $left, array $right) {
return [
// only in left
array_diff_key($left, $right),
// common keys
array_intersect_key($left, $right),
// only in right
array_diff_key($right, $left)
];
... | php | public static function circularDiffKeys(array $left, array $right) {
return [
// only in left
array_diff_key($left, $right),
// common keys
array_intersect_key($left, $right),
// only in right
array_diff_key($right, $left)
];
... | [
"public",
"static",
"function",
"circularDiffKeys",
"(",
"array",
"$",
"left",
",",
"array",
"$",
"right",
")",
"{",
"return",
"[",
"// only in left",
"array_diff_key",
"(",
"$",
"left",
",",
"$",
"right",
")",
",",
"// common keys",
"array_intersect_key",
"("... | Perform a circular diff between two arrays using keys.
This method returns an array containing:
[
[keys in $left array but not in $right],
[keys in both %left and $right],
[keys in $right but not in $left],
]
@param array $left
@param array $right
@return array | [
"Perform",
"a",
"circular",
"diff",
"between",
"two",
"arrays",
"using",
"keys",
"."
] | 21ed690e81763ed9e1ef7721a7eb4fcc0fcefc1a | https://github.com/comodojo/foundation/blob/21ed690e81763ed9e1ef7721a7eb4fcc0fcefc1a/src/Comodojo/Foundation/Utils/ArrayOps.php#L35-L46 |
192,982 | comodojo/foundation | src/Comodojo/Foundation/Utils/ArrayOps.php | ArrayOps.replaceStrict | public static function replaceStrict(array $source, array ...$replace) {
$replacements = [];
foreach ($replace as $items) {
$replacements[] = array_intersect_key($items, $source);
}
return array_merge($source, ...$replacements);
} | php | public static function replaceStrict(array $source, array ...$replace) {
$replacements = [];
foreach ($replace as $items) {
$replacements[] = array_intersect_key($items, $source);
}
return array_merge($source, ...$replacements);
} | [
"public",
"static",
"function",
"replaceStrict",
"(",
"array",
"$",
"source",
",",
"array",
"...",
"$",
"replace",
")",
"{",
"$",
"replacements",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"replace",
"as",
"$",
"items",
")",
"{",
"$",
"replacements",
"["... | Replace items only if relative keys are actually defined in source array
@param array $source
@param array $replace
@return array | [
"Replace",
"items",
"only",
"if",
"relative",
"keys",
"are",
"actually",
"defined",
"in",
"source",
"array"
] | 21ed690e81763ed9e1ef7721a7eb4fcc0fcefc1a | https://github.com/comodojo/foundation/blob/21ed690e81763ed9e1ef7721a7eb4fcc0fcefc1a/src/Comodojo/Foundation/Utils/ArrayOps.php#L68-L78 |
192,983 | wb-crowdfusion/crowdfusion | system/core/classes/nodedb/utils/MetaUtils.php | MetaUtils.validateMeta | public static function validateMeta(array &$array)
{
foreach ($array as $key => $tag) {
if (!($tag instanceof Meta)) {
$newtag = new Meta($tag);
$array[$key] = $newtag;
}
}
} | php | public static function validateMeta(array &$array)
{
foreach ($array as $key => $tag) {
if (!($tag instanceof Meta)) {
$newtag = new Meta($tag);
$array[$key] = $newtag;
}
}
} | [
"public",
"static",
"function",
"validateMeta",
"(",
"array",
"&",
"$",
"array",
")",
"{",
"foreach",
"(",
"$",
"array",
"as",
"$",
"key",
"=>",
"$",
"tag",
")",
"{",
"if",
"(",
"!",
"(",
"$",
"tag",
"instanceof",
"Meta",
")",
")",
"{",
"$",
"new... | Validates that the given array contains all valid Meta entries
@param array &$array An array of strings or Meta objects
@return void
@throws Exception if any items are invalid. | [
"Validates",
"that",
"the",
"given",
"array",
"contains",
"all",
"valid",
"Meta",
"entries"
] | 8cad7988f046a6fefbed07d026cb4ae6706c1217 | https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/nodedb/utils/MetaUtils.php#L36-L45 |
192,984 | wb-crowdfusion/crowdfusion | system/core/classes/nodedb/utils/MetaUtils.php | MetaUtils.truncateToMax | public static function truncateToMax($obj, $metaName, $string, $ellipsis = false)
{
switch (true) {
case $obj instanceof Element:
case $obj instanceof Aspect:
break;
case $obj instanceof NodeRef:
case $obj instanceof Node:
$obj ... | php | public static function truncateToMax($obj, $metaName, $string, $ellipsis = false)
{
switch (true) {
case $obj instanceof Element:
case $obj instanceof Aspect:
break;
case $obj instanceof NodeRef:
case $obj instanceof Node:
$obj ... | [
"public",
"static",
"function",
"truncateToMax",
"(",
"$",
"obj",
",",
"$",
"metaName",
",",
"$",
"string",
",",
"$",
"ellipsis",
"=",
"false",
")",
"{",
"switch",
"(",
"true",
")",
"{",
"case",
"$",
"obj",
"instanceof",
"Element",
":",
"case",
"$",
... | Returns a string truncated to fit inside a meta.
@param mixed $obj - object that has the schema
(Node | NodeRef | Element | Aspect)
@param string $metaName
@param string $string - string to be truncated
@param bool $ellipsis - if set, output is appended with three dots
@return string | [
"Returns",
"a",
"string",
"truncated",
"to",
"fit",
"inside",
"a",
"meta",
"."
] | 8cad7988f046a6fefbed07d026cb4ae6706c1217 | https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/nodedb/utils/MetaUtils.php#L164-L195 |
192,985 | OUTRAGElib/objectlist | lib/ObjectListPopulationTrait.php | ObjectListPopulationTrait.populateObjectList | public final function populateObjectList($input, $deep = true)
{
if($this instanceof ArrayAccess == false)
throw new Exception("Cannot set properties on objects that are not children of 'ArrayAccess'");
if(!is_array($input))
{
if($input instanceof Traversable && method_exists($input, "toArray"))
$in... | php | public final function populateObjectList($input, $deep = true)
{
if($this instanceof ArrayAccess == false)
throw new Exception("Cannot set properties on objects that are not children of 'ArrayAccess'");
if(!is_array($input))
{
if($input instanceof Traversable && method_exists($input, "toArray"))
$in... | [
"public",
"final",
"function",
"populateObjectList",
"(",
"$",
"input",
",",
"$",
"deep",
"=",
"true",
")",
"{",
"if",
"(",
"$",
"this",
"instanceof",
"ArrayAccess",
"==",
"false",
")",
"throw",
"new",
"Exception",
"(",
"\"Cannot set properties on objects that a... | Populate an object list from, well, anything really | [
"Populate",
"an",
"object",
"list",
"from",
"well",
"anything",
"really"
] | 8ac3f9fd99992c58a3f537325e02ba2337f9ee55 | https://github.com/OUTRAGElib/objectlist/blob/8ac3f9fd99992c58a3f537325e02ba2337f9ee55/lib/ObjectListPopulationTrait.php#L15-L51 |
192,986 | OUTRAGElib/objectlist | lib/ObjectListPopulationTrait.php | ObjectListPopulationTrait.populateWithReference | public final function populateWithReference(array &$input)
{
if($this instanceof ObjectList == false)
throw new Exception("Cannot set list to reference on non-supported object types");
$this->list = &$input;
return $this;
} | php | public final function populateWithReference(array &$input)
{
if($this instanceof ObjectList == false)
throw new Exception("Cannot set list to reference on non-supported object types");
$this->list = &$input;
return $this;
} | [
"public",
"final",
"function",
"populateWithReference",
"(",
"array",
"&",
"$",
"input",
")",
"{",
"if",
"(",
"$",
"this",
"instanceof",
"ObjectList",
"==",
"false",
")",
"throw",
"new",
"Exception",
"(",
"\"Cannot set list to reference on non-supported object types\"... | Populate this object with a reference | [
"Populate",
"this",
"object",
"with",
"a",
"reference"
] | 8ac3f9fd99992c58a3f537325e02ba2337f9ee55 | https://github.com/OUTRAGElib/objectlist/blob/8ac3f9fd99992c58a3f537325e02ba2337f9ee55/lib/ObjectListPopulationTrait.php#L57-L65 |
192,987 | bandama-framework/bandama-framework | src/foundation/database/QueryBuilder.php | QueryBuilder.getQuery | public function getQuery() {
$query = 'SELECT '.implode(', ', $this->fields)
.' FROM '.implode(', ', $this->from);
if (count($this->conditions) > 0) {
$query = $query.' WHERE '.implode(' AND ', $this->conditions);
}
$query = rtrim($query).';';
return ... | php | public function getQuery() {
$query = 'SELECT '.implode(', ', $this->fields)
.' FROM '.implode(', ', $this->from);
if (count($this->conditions) > 0) {
$query = $query.' WHERE '.implode(' AND ', $this->conditions);
}
$query = rtrim($query).';';
return ... | [
"public",
"function",
"getQuery",
"(",
")",
"{",
"$",
"query",
"=",
"'SELECT '",
".",
"implode",
"(",
"', '",
",",
"$",
"this",
"->",
"fields",
")",
".",
"' FROM '",
".",
"implode",
"(",
"', '",
",",
"$",
"this",
"->",
"from",
")",
";",
"if",
"(",
... | Build query to generate a string
@return string | [
"Build",
"query",
"to",
"generate",
"a",
"string"
] | 234ed703baf9e31268941c9d5f6d5e004cc53066 | https://github.com/bandama-framework/bandama-framework/blob/234ed703baf9e31268941c9d5f6d5e004cc53066/src/foundation/database/QueryBuilder.php#L81-L90 |
192,988 | pdscopes/php-arrays | src/ArrDots.php | ArrDots.explode | public static function explode($array)
{
$results = [];
foreach ($array as $key => $value) {
static::set($results, $key, $value);
}
return $results;
} | php | public static function explode($array)
{
$results = [];
foreach ($array as $key => $value) {
static::set($results, $key, $value);
}
return $results;
} | [
"public",
"static",
"function",
"explode",
"(",
"$",
"array",
")",
"{",
"$",
"results",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"array",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"static",
"::",
"set",
"(",
"$",
"results",
",",
"$",
"key",... | Explode a single level dots array into a multi-dimensional associative array.
@param array $array
@return array | [
"Explode",
"a",
"single",
"level",
"dots",
"array",
"into",
"a",
"multi",
"-",
"dimensional",
"associative",
"array",
"."
] | 4648ef6d34a63682f4cb367716ba7c205b60ae1f | https://github.com/pdscopes/php-arrays/blob/4648ef6d34a63682f4cb367716ba7c205b60ae1f/src/ArrDots.php#L45-L54 |
192,989 | pdscopes/php-arrays | src/ArrDots.php | ArrDots.collate | public static function collate($array, $key, $wildcard = null)
{
// If no wildcard set or the wildcard is not in the key
if (null === $wildcard || strpos($key, $wildcard) === false) {
return static::has($array, $key) ? [$key => static::get($array, $key)] : [];
}
$pattern... | php | public static function collate($array, $key, $wildcard = null)
{
// If no wildcard set or the wildcard is not in the key
if (null === $wildcard || strpos($key, $wildcard) === false) {
return static::has($array, $key) ? [$key => static::get($array, $key)] : [];
}
$pattern... | [
"public",
"static",
"function",
"collate",
"(",
"$",
"array",
",",
"$",
"key",
",",
"$",
"wildcard",
"=",
"null",
")",
"{",
"// If no wildcard set or the wildcard is not in the key",
"if",
"(",
"null",
"===",
"$",
"wildcard",
"||",
"strpos",
"(",
"$",
"key",
... | Get all items from a multi-dimensional associative array using "dots" notation and
return a flattened "dots" notation array.
@param ArrayAccess|array $array
@param string $key
@param null|string $wildcard
@return array|mixed[] | [
"Get",
"all",
"items",
"from",
"a",
"multi",
"-",
"dimensional",
"associative",
"array",
"using",
"dots",
"notation",
"and",
"return",
"a",
"flattened",
"dots",
"notation",
"array",
"."
] | 4648ef6d34a63682f4cb367716ba7c205b60ae1f | https://github.com/pdscopes/php-arrays/blob/4648ef6d34a63682f4cb367716ba7c205b60ae1f/src/ArrDots.php#L178-L215 |
192,990 | pdscopes/php-arrays | src/ArrDots.php | ArrDots.has | public static function has($array, $keys, $wildcard = null)
{
// If the keys are null or the array is not accessible
if (null === $keys || empty($array) || !Arr::accessible($array)) {
return false;
}
// Check that every key exists in $array
$originalArray = $arra... | php | public static function has($array, $keys, $wildcard = null)
{
// If the keys are null or the array is not accessible
if (null === $keys || empty($array) || !Arr::accessible($array)) {
return false;
}
// Check that every key exists in $array
$originalArray = $arra... | [
"public",
"static",
"function",
"has",
"(",
"$",
"array",
",",
"$",
"keys",
",",
"$",
"wildcard",
"=",
"null",
")",
"{",
"// If the keys are null or the array is not accessible",
"if",
"(",
"null",
"===",
"$",
"keys",
"||",
"empty",
"(",
"$",
"array",
")",
... | Determine if an item or items exist in an multi-dimensional associative array using "dots" notation.
@param ArrayAccess|array $array
@param string|string[] $keys
@param null|string $wildcard
@return bool | [
"Determine",
"if",
"an",
"item",
"or",
"items",
"exist",
"in",
"an",
"multi",
"-",
"dimensional",
"associative",
"array",
"using",
"dots",
"notation",
"."
] | 4648ef6d34a63682f4cb367716ba7c205b60ae1f | https://github.com/pdscopes/php-arrays/blob/4648ef6d34a63682f4cb367716ba7c205b60ae1f/src/ArrDots.php#L226-L276 |
192,991 | phossa/phossa-route | src/Phossa/Route/Context/Request.php | Request.parseUrl | protected function parseUrl(
/*# string */ $httpMethod,
/*# string */ $url
) {
$this->server = $_SERVER;
$server = &$this->server;
// set http method
if ($httpMethod) {
$server['REQUEST_METHOD'] = $httpMethod;
} elseif (!isset($server['REQUEST_MET... | php | protected function parseUrl(
/*# string */ $httpMethod,
/*# string */ $url
) {
$this->server = $_SERVER;
$server = &$this->server;
// set http method
if ($httpMethod) {
$server['REQUEST_METHOD'] = $httpMethod;
} elseif (!isset($server['REQUEST_MET... | [
"protected",
"function",
"parseUrl",
"(",
"/*# string */",
"$",
"httpMethod",
",",
"/*# string */",
"$",
"url",
")",
"{",
"$",
"this",
"->",
"server",
"=",
"$",
"_SERVER",
";",
"$",
"server",
"=",
"&",
"$",
"this",
"->",
"server",
";",
"// set http method"... | Parse a given URL
@param string $httpMethod HTTP method
@param string $url URL
@return status
@access protected | [
"Parse",
"a",
"given",
"URL"
] | fdcc1c814b8b1692a60d433d3c085e6c7a923acc | https://github.com/phossa/phossa-route/blob/fdcc1c814b8b1692a60d433d3c085e6c7a923acc/src/Phossa/Route/Context/Request.php#L127-L174 |
192,992 | ZFury/framework | library/Media/File.php | File.getAudios | public function getAudios()
{
$qb = $this->entityManager->createQueryBuilder();
$qb->select('f')
->from('\Media\Entity\File', 'f')
->innerJoin('\Media\Entity\ObjectFile', 'obf', Join::WITH, 'f.id = obf.fileId')
->where('f.type = :type')
->andWhere('obf... | php | public function getAudios()
{
$qb = $this->entityManager->createQueryBuilder();
$qb->select('f')
->from('\Media\Entity\File', 'f')
->innerJoin('\Media\Entity\ObjectFile', 'obf', Join::WITH, 'f.id = obf.fileId')
->where('f.type = :type')
->andWhere('obf... | [
"public",
"function",
"getAudios",
"(",
")",
"{",
"$",
"qb",
"=",
"$",
"this",
"->",
"entityManager",
"->",
"createQueryBuilder",
"(",
")",
";",
"$",
"qb",
"->",
"select",
"(",
"'f'",
")",
"->",
"from",
"(",
"'\\Media\\Entity\\File'",
",",
"'f'",
")",
... | Returns an array of ids
@return mixed | [
"Returns",
"an",
"array",
"of",
"ids"
] | eee4ca2a64d2d65490777b08be56c4c9b67bc892 | https://github.com/ZFury/framework/blob/eee4ca2a64d2d65490777b08be56c4c9b67bc892/library/Media/File.php#L49-L63 |
192,993 | tonis-io-legacy/tonis | src/App.php | App.router | public function router()
{
return new Router\Router($this->routeMap, new Router\Resolver\Container($this->container));
} | php | public function router()
{
return new Router\Router($this->routeMap, new Router\Resolver\Container($this->container));
} | [
"public",
"function",
"router",
"(",
")",
"{",
"return",
"new",
"Router",
"\\",
"Router",
"(",
"$",
"this",
"->",
"routeMap",
",",
"new",
"Router",
"\\",
"Resolver",
"\\",
"Container",
"(",
"$",
"this",
"->",
"container",
")",
")",
";",
"}"
] | Routers are middleware and can be added to Tonis.
e.g., $router = $app->router();
$router->get(...)
$app->add($router);
@return Router\Router | [
"Routers",
"are",
"middleware",
"and",
"can",
"be",
"added",
"to",
"Tonis",
"."
] | 8371a277a94232433d882aaf37a85cd469daf501 | https://github.com/tonis-io-legacy/tonis/blob/8371a277a94232433d882aaf37a85cd469daf501/src/App.php#L88-L91 |
192,994 | tonis-io-legacy/tonis | src/App.php | App.decorateRequest | private function decorateRequest(ServerRequestInterface $request)
{
if ($request instanceof Http\Request) {
return $request;
}
return new Http\Request($this, $request);
} | php | private function decorateRequest(ServerRequestInterface $request)
{
if ($request instanceof Http\Request) {
return $request;
}
return new Http\Request($this, $request);
} | [
"private",
"function",
"decorateRequest",
"(",
"ServerRequestInterface",
"$",
"request",
")",
"{",
"if",
"(",
"$",
"request",
"instanceof",
"Http",
"\\",
"Request",
")",
"{",
"return",
"$",
"request",
";",
"}",
"return",
"new",
"Http",
"\\",
"Request",
"(",
... | Decorates a request to add this app to it.
@param ServerRequestInterface $request
@return ServerRequestInterface|Http\Request | [
"Decorates",
"a",
"request",
"to",
"add",
"this",
"app",
"to",
"it",
"."
] | 8371a277a94232433d882aaf37a85cd469daf501 | https://github.com/tonis-io-legacy/tonis/blob/8371a277a94232433d882aaf37a85cd469daf501/src/App.php#L250-L257 |
192,995 | tonis-io-legacy/tonis | src/App.php | App.decorateResponse | private function decorateResponse(ResponseInterface $response)
{
if ($response instanceof Http\Response) {
return $response;
}
return new Http\Response($this, $response);
} | php | private function decorateResponse(ResponseInterface $response)
{
if ($response instanceof Http\Response) {
return $response;
}
return new Http\Response($this, $response);
} | [
"private",
"function",
"decorateResponse",
"(",
"ResponseInterface",
"$",
"response",
")",
"{",
"if",
"(",
"$",
"response",
"instanceof",
"Http",
"\\",
"Response",
")",
"{",
"return",
"$",
"response",
";",
"}",
"return",
"new",
"Http",
"\\",
"Response",
"(",... | Decorates a response to add this app to it.
@param ResponseInterface $response
@return ResponseInterface|Http\Response | [
"Decorates",
"a",
"response",
"to",
"add",
"this",
"app",
"to",
"it",
"."
] | 8371a277a94232433d882aaf37a85cd469daf501 | https://github.com/tonis-io-legacy/tonis/blob/8371a277a94232433d882aaf37a85cd469daf501/src/App.php#L265-L272 |
192,996 | fiiSoft/fiisoft-basics | src/Tools/Validation/SpecificationValidator.php | SpecificationValidator.normalizeSpecification | private function normalizeSpecification(array $input)
{
$output = [];
$mayBeChildless = null;
foreach ($input as $key => $spec) {
if ($key === 'attributes') {
if (!is_array($spec)) {
throw new LogicException('Value under key '.$key.' h... | php | private function normalizeSpecification(array $input)
{
$output = [];
$mayBeChildless = null;
foreach ($input as $key => $spec) {
if ($key === 'attributes') {
if (!is_array($spec)) {
throw new LogicException('Value under key '.$key.' h... | [
"private",
"function",
"normalizeSpecification",
"(",
"array",
"$",
"input",
")",
"{",
"$",
"output",
"=",
"[",
"]",
";",
"$",
"mayBeChildless",
"=",
"null",
";",
"foreach",
"(",
"$",
"input",
"as",
"$",
"key",
"=>",
"$",
"spec",
")",
"{",
"if",
"(",... | Convert simplified specification to full form used in validation.
@param array $input specification
@throws LogicException
@return array normalized specification | [
"Convert",
"simplified",
"specification",
"to",
"full",
"form",
"used",
"in",
"validation",
"."
] | cf0e56a9abf646fae075f16e65eced282601c193 | https://github.com/fiiSoft/fiisoft-basics/blob/cf0e56a9abf646fae075f16e65eced282601c193/src/Tools/Validation/SpecificationValidator.php#L251-L320 |
192,997 | linguisticteam/xml-sitemap | src/sitemap.php | XMLSitemap.getXML | public function getXML( $version = '1.0', $encoding = 'UTF-8', $willFormatOutput = true )
{
if (is_null( self::$instance )) {
self::$instance = new \DOMDocument( $version, $encoding );
self::$instance->formatOutput = $willFormatOutput;
}
return self::$i... | php | public function getXML( $version = '1.0', $encoding = 'UTF-8', $willFormatOutput = true )
{
if (is_null( self::$instance )) {
self::$instance = new \DOMDocument( $version, $encoding );
self::$instance->formatOutput = $willFormatOutput;
}
return self::$i... | [
"public",
"function",
"getXML",
"(",
"$",
"version",
"=",
"'1.0'",
",",
"$",
"encoding",
"=",
"'UTF-8'",
",",
"$",
"willFormatOutput",
"=",
"true",
")",
"{",
"if",
"(",
"is_null",
"(",
"self",
"::",
"$",
"instance",
")",
")",
"{",
"self",
"::",
"$",
... | Creates the instance of DOMDocument all classes will be working with.
@param string $version
@param string $encoding
@param bool $willFormatOutput
@return \DOMDocument | [
"Creates",
"the",
"instance",
"of",
"DOMDocument",
"all",
"classes",
"will",
"be",
"working",
"with",
"."
] | b600a31ad9c1c136fa6f3d3b6a394002121d42f0 | https://github.com/linguisticteam/xml-sitemap/blob/b600a31ad9c1c136fa6f3d3b6a394002121d42f0/src/sitemap.php#L39-L47 |
192,998 | linguisticteam/xml-sitemap | src/sitemap.php | XMLSitemap.addChild | protected function addChild( $attribute, $value = null, $escape = false )
{
if ( ! empty( $value )) {
if ($escape === true) {
$node = $this->XML->createElement( $attribute );
$node->appendChild( new \DOMCdataSection( $value ) );
} else {
... | php | protected function addChild( $attribute, $value = null, $escape = false )
{
if ( ! empty( $value )) {
if ($escape === true) {
$node = $this->XML->createElement( $attribute );
$node->appendChild( new \DOMCdataSection( $value ) );
} else {
... | [
"protected",
"function",
"addChild",
"(",
"$",
"attribute",
",",
"$",
"value",
"=",
"null",
",",
"$",
"escape",
"=",
"false",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"value",
")",
")",
"{",
"if",
"(",
"$",
"escape",
"===",
"true",
")",
"{",
... | Adds a child node to the main node that each inherited class creates when it instantiates itself.
@param $attribute
@param null $value
@param bool $escape Whether to escape the value, we usually escape any field that might contain special characters
to avoid using special char handler methods | [
"Adds",
"a",
"child",
"node",
"to",
"the",
"main",
"node",
"that",
"each",
"inherited",
"class",
"creates",
"when",
"it",
"instantiates",
"itself",
"."
] | b600a31ad9c1c136fa6f3d3b6a394002121d42f0 | https://github.com/linguisticteam/xml-sitemap/blob/b600a31ad9c1c136fa6f3d3b6a394002121d42f0/src/sitemap.php#L77-L88 |
192,999 | linguisticteam/xml-sitemap | src/sitemap.php | XMLSitemap.addStylesheet | public function addStylesheet( $url )
{
$this->XML->appendChild( $this->XML->createProcessingInstruction( 'xml-stylesheet',
sprintf( 'type="text/xsl" href="%s"', $url ) ) );
} | php | public function addStylesheet( $url )
{
$this->XML->appendChild( $this->XML->createProcessingInstruction( 'xml-stylesheet',
sprintf( 'type="text/xsl" href="%s"', $url ) ) );
} | [
"public",
"function",
"addStylesheet",
"(",
"$",
"url",
")",
"{",
"$",
"this",
"->",
"XML",
"->",
"appendChild",
"(",
"$",
"this",
"->",
"XML",
"->",
"createProcessingInstruction",
"(",
"'xml-stylesheet'",
",",
"sprintf",
"(",
"'type=\"text/xsl\" href=\"%s\"'",
... | Adds the XSL stylesheet to our document
@param $url | [
"Adds",
"the",
"XSL",
"stylesheet",
"to",
"our",
"document"
] | b600a31ad9c1c136fa6f3d3b6a394002121d42f0 | https://github.com/linguisticteam/xml-sitemap/blob/b600a31ad9c1c136fa6f3d3b6a394002121d42f0/src/sitemap.php#L105-L109 |
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.