Run Application
@param  String $route Route to parse
@return void
548879
public function run($route = null) {

        $self = $this;

        if ($route) {
            $this->registry['route'] = $route;
        }

        \register_shutdown_function(function() use($self){
            $self->trigger('shutdown');
        });

        $this->response = new Response();
        $this->trigger('before');
        $this->response->body = $this->dispatch($this->registry['route']);

        if ($this->response->body === false) {
            $this->response->status = 404;
        }

        $this->trigger('after');

        if ($this->response->gzip && !\ob_start('ob_gzhandler')) {
            \ob_start();
        }

        $this->response->flush();
    }
1204131
public function dispatch(Route $route)
    {
        do {
            $this->getEventManager()->publish("pre.dispatch", array($route, $this));

            $protoView = $this->_view->cloneThis();
            $controllerClassName = $route->getControllerName() . "Controller";
            $action = $route->getActionName() . "Action";
            $classPath = $this->getControllerPath() . DIRECTORY_SEPARATOR . $controllerClassName . ".php";
            $viewPath = $route->getControllerPath()
                . DIRECTORY_SEPARATOR
                . $route->getActionPath()
                . $protoView->getViewExt();

            if (!file_exists($classPath)) {
                // Use base controller
                $controllerClassName = 'Controller';
            } else {
                require_once $classPath;
            }

            $controller = new $controllerClassName($this);
            $controller->setRouter($this->getRouter());
            $controller->setRequest($this->getRequest());
            $controller->setParams(
                array_merge(
                    array(
                        "dispatcher" => $this,
                        "bootstrap" => $this->getBootstrap()
                    ),
                    $route->getParams()));
            $controller->setRawBody(@file_get_contents('php://input'));

            $controller->setView($protoView->cloneThis());
            $controller->view->controllerPath = $this->getControllerPath();

            if (method_exists($controller, $action)) {
                ob_start();
                $controller->init();
                $controller->$action();
                array_push($this->_viewsQueue, ob_get_contents());
                ob_end_clean();
            } else {
                if (!file_exists($controller->view->getViewPath() . DIRECTORY_SEPARATOR . $viewPath)) {
                    throw new RuntimeException("Page not found {$route->getControllerName()} -> {$route->getActionName()}", 404);
                }
            }

            if ($controller->view->getViewPath()) {
                array_push(
                    $this->_viewsQueue,
                    $controller->getView()->render(
                        (($controller->getViewPath() !== false) ? $controller->getViewPath() : $viewPath))
                );
            }

            $this->getEventManager()->publish("post.dispatch", array($this));
        } while(($route = array_shift($this->_actions)));

        return implode("", $this->_viewsQueue);
    }
492445
protected function processRoute($route)
	{
		$routeAction = $route->getAction();

		$this->getParentCommand()->info('Processing route [' . implode('/', $route->methods()) . '] ' . $routeAction['uri']);

		$routeControllerDocBlock = $this->getRouteControllerDocBlock($route);
		$routeControllerOperationTags = $this->getDocBlockOperationTags($routeControllerDocBlock);

		foreach ($route->methods() as $httpMethod) {
			// Ignore HEAD

			if (strtolower($httpMethod) == 'head') {
				continue;
			}

			if (isset($this->openAPI->paths[$routeAction['uri']])) {
				$pathItem = $this->openAPI->paths[$routeAction['uri']];
			} else {
				$pathItem = $this->openAPI->paths[$routeAction['uri']] = new PathItem();

				if (!is_null($routeControllerDocBlock)) {
					$pathItem->summary = $routeControllerDocBlock->getSummary();
					if (empty($pathItem->summary)) {
						$pathItem->summary = null;
					}
					$routeControllerDescriptionDocBlock = $routeControllerDocBlock->getDescription();
					$pathItem->description = $routeControllerDescriptionDocBlock->render();
					if (empty($pathItem->description)) {
						$pathItem->description = null;
					}
				}
			}

			$operation = new Operation();

			$operationTags = $routeControllerOperationTags;

			$routeMethodDocBlock = $this->getRouteMethodDocBlock($route);
			$extraParameterRefTags = [];

			if (!is_null($routeMethodDocBlock)) {
				$operation->summary = $routeMethodDocBlock->getSummary();
				if (empty($operation->summary)) {
					$operation->summary = null;
				}
				$routeMethodDescriptionDocBlock = $routeMethodDocBlock->getDescription();
				$operation->description = $routeMethodDescriptionDocBlock->render();
				if (empty($operation->description)) {
					$operation->description = null;
				}
				$routeMethodOperationTags = $this->getDocBlockOperationTags($routeMethodDocBlock);

				$operationTags = array_merge($routeControllerOperationTags, $routeMethodOperationTags);
				$extraParameterRefTags = $this->getDocBlockExtraParameterRefTags($routeMethodDocBlock);

				$operation->operationId = $this->getDocBlockOperationId($routeMethodDocBlock);
			}

			if (is_null($operation->operationId)) {
				switch (strtolower($httpMethod)) {
					case 'patch':
					case 'put':
						$operation->operationId = strtolower($httpMethod) . ucfirst(array_last(explode('.', $routeAction['as'])));
						break;
					default :
						$operation->operationId = array_last(explode('.', $routeAction['as']));
				}
			}

			if (count($operationTags) > 0) {
				$operation->tags = $operationTags;
			}

			// Try
			$routePathParameters = $this->getRoutePathParameters($route);

			foreach ($routePathParameters as $parameterName => $parameterData) {
				$parameterDescription = isset($parameterData['docDescription']) ? $parameterData['docDescription'] : '';
				if (trim($parameterDescription) == '') {
					$parameterDescription = null;
				}
				$parameter = new Parameter([
					'name' => $parameterName,
					'in' => 'path',
					'description' => $parameterDescription,
					'required' => true,
				]);
				if (isset($parameterData['type'])) {
					$parameter->schema = new Schema([
						'type' => $parameterData['type']
					]);
				}
				if (isset($parameterData['docType'])) {
					$parameter->schema = new Schema([
						'type' => $parameterData['docType']
					]);
				}
				$operation->parameters[] = $parameter;
			}

			// Try to get route validation rules
			$routeValidationRules = $this->getRouteValidationRules($route);

			if (count($routeValidationRules) > 0) {
				switch (strtolower($httpMethod)) {
					case 'get':
					//case 'head':

						foreach ($routeValidationRules as $parameterName => $rulesString) {
							$rules = explode('|', $rulesString);

							$parameter = new Parameter([
								'name' => $parameterName,
								'in' => 'query',
								'description' => null, /* @todo Grab description from phpdoc custom tag ? */
								'required' => in_array('required', $rules),
							]);

							$parameter->schema = $this->getPropertyValidationRulesSchema(
								$rules,
								'Validation rules for parameter "' . $parameterName . '"',
								true
							);
							
							if (is_null($parameter->schema->format)) {
								// ignore this parameter if no type found
								$this->getParentCommand()->warn('  Ignore parameter "' . $parameterName . '"');
								continue;
							}

							// Add if not already added from the "path" parameters
							$find = false;
							if (is_null($operation->parameters)) {
								$operation->parameters = [];
							}
							/** @var Parameter $p */
							foreach ($operation->parameters as $p) {
								if ($p->name == $parameter->name) {
									$find = true;
								}
							}
							if (!$find) {
								$operation->parameters[] = $parameter;
							}
						}

						break;

					case 'put':
					case 'patch':
					case 'post':

						$requestBody = new RequestBody();
						$mediaType = new MediaType();
						$mediaType->schema = new Schema();
						$mediaType->schema->properties = [];

						// Change to multi-part if file in parameters ("string" type and "binary" format)
						$contentType = 'application/json';
						
						foreach ($routeValidationRules as $parameterName => $rulesString) {
							$rules = explode('|', $rulesString);
							$schema = $this->getPropertyValidationRulesSchema(
								$rules,
								'Validation rules for parameter "' . $parameterName . '"',
								true
							);
							
							// ignore this property if no type found
							if (is_null($schema->type)) {
								$this->getParentCommand()->warn('  Ignore parameter "' . $parameterName . '"');
								continue;
							}
							
							// Change to multi-part if file in parameters ("string" type and "binary" format)
							if ($schema->type == 'string' && $schema->format == 'binary') {
								$contentType = 'multipart/form-data';
								// Change mediaType schema type
								$mediaType->schema->type = 'object';
							}
							
							$mediaType->schema->properties[$parameterName] = $schema;
						}

						$mediaType->schema->required = $this->getValidationRulesSchemaRequired($routeValidationRules);

						$requestBody->content[$contentType] = $mediaType;
						$operation->requestBody = $requestBody;

						$operation->responses = [];

						break;
				}
			}

			// Append extra parameter refs

			foreach ($extraParameterRefTags as $extraParameterRefTag) {
				$parameterRef = new Reference([
					'ref' => $extraParameterRefTag
				]);

				if (is_null($operation->parameters)) {
					$operation->parameters = [];
				}

				$operation->parameters[] = $parameterRef;
			}

			// First response

			$response = new Response();
			$responseMediaType = null;

			$apiResponseSchemaRefTags = $routeMethodDocBlock->getTagsByName('OpenApiResponseSchemaRef');
			if (count($apiResponseSchemaRefTags) > 0) {
				if (is_null($responseMediaType)) {
					$responseMediaType = new MediaType();
				}
				$apiResponseSchemaRefTag = $apiResponseSchemaRefTags[0];
				$apiResponseSchemaRef = trim(str_replace('@OpenApiResponseSchemaRef', '', $apiResponseSchemaRefTag->render()));
				$responseMediaType->schema = new Reference([
					'ref' => $apiResponseSchemaRef
				]);
			}
			
			$response->description = '';
			$apiResponseDescriptionTags = $routeMethodDocBlock->getTagsByName('OpenApiResponseDescription');
			if (count($apiResponseDescriptionTags) > 0) {
				$apiResponseDescriptionTag = $apiResponseDescriptionTags[0];
				$apiResponseDescription = trim(str_replace('@OpenApiResponseDescription', '', $apiResponseDescriptionTag->render()));
				$response->description = $apiResponseDescription;
			}

			$apiDocsNoCallTags = $routeMethodDocBlock->getTagsByName('ApiDocsNoCall');
			if (count($apiDocsNoCallTags) == 0) {
				$exampleResponse = $this->getRouteCallExampleResponse($route, $httpMethod);
				if (!is_null($exampleResponse)) {
					if (is_null($responseMediaType)) {
						$responseMediaType = new MediaType();
					}

					$exampleSchemaId = $this->getRouteExampleResponseId($route);

					// Create Example schema in components

					if (is_null($this->openAPI->components)) {
						$this->openAPI->components = new Components();
					}

					$this->openAPI->components->examples[$exampleSchemaId] = new Example([
						'value' => json_decode($exampleResponse, true)
					]);

					$responseMediaType->example = new Reference([
						'ref' => '#/components/examples/' . $exampleSchemaId
					]);
				}
			}

			if (!is_null($responseMediaType)) {
				$response->content['application/json'] = $responseMediaType;
			}
			
			// Excepted HTTP code specified ? "OpenApiResponseExceptedHTTPCode" tag
			
			$apiResponseExceptedHTTPCode = null;
			$apiResponseExceptedHTTPCodeTags = $routeMethodDocBlock->getTagsByName('OpenApiResponseExceptedHTTPCode');
			if (count($apiResponseExceptedHTTPCodeTags) > 0) {
				$apiResponseExceptedHTTPCodeTag = $apiResponseExceptedHTTPCodeTags[0];
				$apiResponseExceptedHTTPCode = trim(str_replace('@OpenApiResponseExceptedHTTPCode', '', $apiResponseExceptedHTTPCodeTag->render()));
			}

			if (!is_null($apiResponseExceptedHTTPCode)) {
				$operation->responses[$apiResponseExceptedHTTPCode] = $response;
			} else {
				switch (strtolower($httpMethod)) {
					case 'get':
						//case 'head':
						$operation->responses['200'] = $response;
						break;
					
					case 'put':
					case 'patch':
						$operation->responses['200'] = $response;
						break;
						
					case 'post':
						$operation->responses['201'] = $response;
						break;
					
					case 'delete':
						$operation->responses['204'] = $response;
						break;
				}
			}

			// Default response (Errors)

			$defaultResponse = new Response();
			$defaultResponseMediaType = null;

			$apiDefaultResponseSchemaRefTags = $routeMethodDocBlock->getTagsByName('OpenApiDefaultResponseSchemaRef');
			if (count($apiDefaultResponseSchemaRefTags) > 0) {
				if (is_null($defaultResponseMediaType)) {
					$defaultResponseMediaType = new MediaType();
				}
				$apiDefaultResponseSchemaRefTag = $apiDefaultResponseSchemaRefTags[0];
				$apiDefaultResponseSchemaRef = trim(str_replace('@OpenApiDefaultResponseSchemaRef', '', $apiDefaultResponseSchemaRefTag->render()));
				$defaultResponseMediaType->schema = new Reference([
					'ref' => $apiDefaultResponseSchemaRef
				]);
			}

			$defaultResponse->description = '';
			$apiDefaultResponseDescriptionTags = $routeMethodDocBlock->getTagsByName('OpenApiDefaultResponseDescription');
			if (count($apiDefaultResponseDescriptionTags) > 0) {
				$apiDefaultResponseDescriptionTag = $apiResponseDescriptionTags[0];
				$apiDefaultResponseDescription = trim(str_replace('@OpenApiDefaultResponseDescription', '', $apiDefaultResponseDescriptionTag->render()));
				$defaultResponse->description = $apiDefaultResponseDescription;
			}

			if (!is_null($defaultResponseMediaType)) {
				$defaultResponse->content['application/json'] = $defaultResponseMediaType;
			}

			$operation->responses['default'] = $defaultResponse;

			$pathItem->{strtolower($httpMethod)} = $operation;
		}
	}
1182515
public function execute($route, array $parameters = array(), \Exedra\Http\ServerRequest $request = null)
    {
        $route = $this->baseRoute($route);

        $request = $request ? : $this->request;

        return $this->app->execute($route, $parameters, $request);
    }
692429
public function run( string $routesFilename=''  )
  {
    #
    # Load the Routes
    #
    if ( empty($routesFilename) ) {
      $routesFilename = $this->getBasePath().'/app/Config/routes.json';
    }
    $this->loadRoutes( $routesFilename );


    # Get Method and URI
    $httpMethod = $this->getRequest()->getMethod();
    $path = $this->getRequest()->getUri()->getPath();
    $routeInfo = null;

    # Find route match in groups
    foreach ($this->getRouteGroups() as $routeGroup)
    {
      # Match the METHOD and URI to the routes in this group
      $routeInfo = $routeGroup->matchRoute($httpMethod,$path);

      if ( count($routeInfo)>0 ) {
        $beforeResult = true; // assume all before handlers succeed
        $routeResult = false;
        $afterResult = true; // assume all after handlers succeed

        # Debug log
        $this->getLogger()->debug('Route matched ',['handler'=>$routeInfo['handler']]);

        #
        # Run the Common AND Groups Before Middlewares (ServerRequestInterface)
        #
        $beforeMiddleware = array_merge($this->beforeMiddleware, $routeGroup->getBeforeMiddleware());

        foreach ($beforeMiddleware as $middleware)
        {
          if (class_exists($middleware) ) {
            $beforeHandler = new $middleware($routeInfo['args']);

            # Debug log
            $this->getLogger()->debug('Running Before middleware',['rid'=>app('requestId'),'middleware'=>$middleware]);

            if (!$beforeHandler->handle($routeInfo['args'])) {
              # Record outcome
              $beforeResult = false;
              # Stop processing more middleware
              break;
            }
          } else {
            # Log
            $this->getLogger()->warning('Before Middleware not found',['rid'=>app('requestId'),'middleware'=>$middleware]);
          }
        }

        #
        # Create & Run the Handler Class - If the Before Middlewares where ok!
        #
        if ($beforeResult) {
          # Extract class & method
          $arr = explode('@',$routeInfo['handler']);
          $handlerClass = $arr[0];
          $handlerMethod = ($arr[1] ?? 'handle');

          # Check existance of handler class
          if (class_exists($handlerClass))
          {
            # Create the class
            $routeHandler = new $handlerClass( $routeInfo['args'] );

            # Check method existance
            if ($routeHandler && method_exists($routeHandler,'initialize') && method_exists($routeHandler,$handlerMethod))
            {
              # Debug log
              $this->getLogger()->debug('Running controller->initialize()',['rid'=>app('requestId'),'controller'=>$handlerClass]);

              # Initialize
              $routeHandler->initialize($routeInfo['args']);

              # Debug log
              $this->getLogger()->debug('Running controller->handle()',['rid'=>app('requestId'),'method'=>$handlerMethod]);

              # Run handler
              $routeResult = $routeHandler->$handlerMethod($routeInfo['args']);
            } else {
              # Log
              $this->getLogger()->error('Method not found in controller ',['rid'=>app('requestId'),'controller'=>$handlerClass,'method'=>$handlerMethod]);
            }
          } else {
            # Debug log
            $this->getLogger()->debug('Controller not found ',['rid'=>app('requestId'),'controller'=>$handlerClass]);
          }
        }

        #
        # Run the After Middlewares (ServerRequestInterface)
        #
        $afterMiddleware = array_merge($this->afterMiddleware,$routeGroup->getAfterMiddleware());
        foreach ($afterMiddleware as $middleware)
        {
          if (class_exists($middleware) ) {
            $afterHandler = new $middleware($routeInfo['args']);

            # Debug log
            $this->getLogger()->debug('Running After middleware',['rid'=>app('requestId'),'middleware'=>$middleware]);

            if (!$afterHandler->handle($routeInfo['args'])) {
              return false;
            }
          } else {
            # Log
            $this->getLogger()->warning('After Middleware not found',['rid'=>app('requestId'),'middleware'=>$middleware]);
          }
        }

        return $routeResult;

      } else {
        # No route matched the URI in this group, we'll look in the next group or exit the foreach()
        $routeInfo = null;
      }

    }

    # Output debug info
    if (is_null($routeInfo)) {
      # Debug log
      $this->getLogger()->debug('No route matched request',['rid'=>app('requestId'),'method'=>$httpMethod,'path'=>$path]);
    }

    return false; // default response
  }
1364409
public function handle(ParsedRoute $route)
    {
        $controller = $route->controller();
        $rawParams = $route->params();
        foreach ($rawParams as $param => $value) {
            if (strpos($controller, "{".$param."}") !== false) {
                $controller = str_replace("{".$param."}", ucfirst($value), $controller);
                unset($rawParams[$param]);
            }
        }
        $segments = explode("::", $controller);
        $controller = $segments[0];
        $action = count($segments) > 1 ? $segments[1] : "index";
        if (method_exists($controller, $action)) {
            $params = [$rawParams];
            return call_user_func_array([new $controller, $action], $params);
        }

        throw new RuntimeException("No method {$action} in controller {$segments[0]}");
    }
620009
public function toRoute($route)
	{
		if ($this->caller != null)
			$this->disableRender[] = $this->caller->identifier;
		$r = $this->router->getRoute($route);
		if ($r != null) {
			$this->currentRoute = $r;
			try {
				$this->execute();
			} catch (\Exception $e) {
				Logger::Log('log/error.txt', $e->getMessage());
				\decoy\base\ErrorController::$errors[] = $e->getMessage();
				$this->toRoute('error_page');
			}
		}
		$this->caller = null;
	}
905548
private function parseRouteConfiguration($route)
    {
        if (!is_array($route)) {
            throw new Exception("Strata configuration file contains an invalid route.");
        }

        return $this->isDynamic($route) ?
            $this->parseDynamicRoute($route) :
            $this->parseMatchedRoute($route);
    }
793250
public function run(string $path): void
    {
        // We need to make sure migration table is available.
        $this->createMigrationRepository();

        $this->migrator->run($path);
    }
75081
public function runController($route)
    {
        if (($ca = $this->createController($route)) !== null) {
            /** @var \Mindy\Controller\BaseController $controller */
            list($controller, $actionID, $params) = $ca;
            $_GET = array_merge($_GET, $params);
            $csrfExempt = $controller->getCsrfExempt();
            if (Console::isCli() === false && in_array($actionID, $csrfExempt) === false) {
                /** @var \Mindy\Http\Request $request */
                $request = $this->getComponent('request');
                if ($request->enableCsrfValidation) {
                    $request->csrf->validate();
                }
            }
            $oldController = $this->_controller;
            $this->_controller = $controller;
            $controller->init();
            $controller->run($actionID, $params);
            $this->_controller = $oldController;
        } else {
            throw new HttpException(404, Mindy::t('base', 'Unable to resolve the request "{route}".', [
                '{route}' => $this->request->getPath()
            ]));
        }
    }
821629
public function run()
    {
        $this->make('Sun\Bootstrap\Provider')->registerRoute();

        $this->route->register();

        $httpMethod = $this->make('Sun\Contracts\Http\Request')->method();

        $uri = $this->make('Sun\Contracts\Routing\UrlGenerator')->getUri();

        $data = $this->route->dispatch($httpMethod, $uri);

        $this->make('Sun\Bootstrap\Provider')->dispatch();

        $this->make('Sun\Contracts\Http\Response')->html($data);
    }
493990
public function run($route, $params = [])
    {
        $this->scanner->stdout('Detect JavaScriptFunction - BEGIN', Console::FG_YELLOW);
        foreach (self::$files[static::EXTENSION] as $file) {
            if ($this->containsTranslator($this->module->jsTranslators, $file)) {
                $this->extractMessages($file, [
                    'translator' => (array) $this->module->jsTranslators,
                    'begin' => '(',
                    'end' => ')',
                ]);
            }
        }

        $this->scanner->stdout('Detect JavaScriptFunction - END', Console::FG_YELLOW);
    }
1283323
public static function run()
    {
        if (!pass('validate_request', 'route/' . self::$_base)) {
            return;
        };

        if (self::$_base !== null  &&  !pass('route/' . self::$_base, self::$_PATH)) {
            trigger('http_status', 500);
        };
    }
730970
public function run(HttpRequest $request = null)
    {
        if (!$this->container->getSetting('debug')) {
            error_reporting(0);
        } else {
            error_reporting(E_ALL);
        }
        
        if (!$request) {
            $request = $this->container->getRequest();
        }
        
        try {
            $parsed = $this->container->getRouter()->parse($request, $this->container->getRoutes());

            if ($parsed['found'] || $this->container->hasRoute('notFound')) {
                if (is_string($parsed['action'])) {
                    # Extract class controller and method
                    list($controller, $method) = explode('::', $parsed['action']);

                    # initialize arguments
                    $arguments = array();
                    # Create a reflection method
                    $reflectionMethod = new \ReflectionMethod($controller, $method);
                    $reflectionParams = $reflectionMethod->getParameters();
                    # Create arguments
                    foreach ($reflectionParams as $param) {
                        if ($paramClass = $param->getClass()) {
                            $className = $paramClass->name;
                            if ($className === 'MVC\\MVC' || $className === '\\MVC\\MVC') {
                                $arguments[] = $this;
                            } elseif ($className === 'MVC\\Server\\HttpRequest' || $className === '\\MVC\\Server\\HttpRequest') {
                                $arguments[] = $request;
                            }
                        } else {
                            foreach ($parsed['params'] as $keyRouteParam => $valueRouteParam) {
                                if ($param->name === $keyRouteParam) {
                                    $arguments[] = $valueRouteParam;
                                    break;
                                }
                            }
                        }
                    }

                    $response = call_user_func_array($reflectionMethod->getClosure(new $controller()), $arguments);

                    if (is_array($response) && !isset($response['body'])) {
                        throw new \LogicException("Invalid response array. Array response haven't body. Expected array('body' => 'string')");
                    } elseif (is_string($response)) {
                        $response = array('body' => $response);
                    }
                } elseif(is_callable($parsed['action'])) {
                    $this->container->getRequest()->params = $parsed['params'];

                    $response = call_user_func_array($parsed['action'], array_values($parsed['params']));
                } else {
                    throw new \LogicException('Route haven\'t action.');
                }
                if ($this->container->hasProvider('monolog')) {
                    $this->container->providers['monolog']->addInfo($response, $parsed);
                }
                $this->container->getResponse()->render($response);
            } else {
                if ($this->container->getSetting('debug')) {
                    throw new \LogicException(sprintf('Route or Resource "%s" not found.', $request->url));
                }
                $this->defaultNotFound();
            }
        } catch (\Exception $e) {
            Error::run($e);
        }
    }
459989
protected function _parse($route) {
		if (is_string($route)) {
			$this->_ensureHere();

			$url = parse_url($route);
			$_path = rtrim($url['path'], '/');
			if ($_path . '?' . Hash::get($url, 'query') === $this->_hereQuery) {
				return true;
			}

			if ($_path === $this->_here) {
				return true;
			}

			return false;
		}

		$count = count($route);
		if ($count == 0) {
			return false;
		}

		foreach ($route as $key => $value) {
			if (array_key_exists($key, $this->request->params)) {
				$values = (array)$value;
				$check = (array)$this->request->params[$key];

				$hasNullValues = (count($values) != count(array_filter($values)) || count($values) == 0);
				$currentValueIsNullish = (in_array(null, $check) || in_array('', $check) || count($check) == 0);
				if ($hasNullValues && $currentValueIsNullish) {
					$count--;
					continue;
				}

				if (in_array($key, array('controller', 'plugin'))) {
					foreach ($check as $k => $_check) {
						$check[$k] = Inflector::underscore(strtolower($_check));
					}
				} else {
					foreach ($check as $k => $_check) {
						$check[$k] = strtolower($_check);
					}
				}

				if (count($values) > 0) {
					foreach ($values as $k => $v) {
						if (in_array(strtolower($v), $check)) {
							$count--;
							break;
						}
					}
				} elseif (count($check) === 0) {
					$count--;
				}
			} elseif (is_numeric($key) && isset($this->request->params['pass'])) {
				if (is_array($this->request->params['pass'])) {
					if (Hash::contains($this->request->params['pass'], $value)) {
						$count--;
					}
				}
			}
		}

		return ($count == 0);
	}
69215
public function handle(ParsedRoute $route)
    {
        $segments = explode("::", $route->controller());
        $controller = $segments[0];
        $action = count($segments) > 1 ? $segments[1] : "index";
        if (method_exists($controller, $action)) {
            $params = [$route->params()];
            return call_user_func_array([new $controller, $action], $params);
        }

        throw new RuntimeException("No method {$action} in controller {$segments[0]}");
    }
1256582
private function buildValidRoute(Route $route): void
    {
        //add to route array the passed uri for param check when call
        $matches = $this->routeMatches;

        //route match and there is a subpattern with action
        if (\count($matches) > 1) {
            //assume that subpattern rapresent action
            $route->action = $matches[1];

            //url clean
            $route->url = \preg_replace('`\([0-9A-Za-z\|]++\)`', $matches[1], $route->url);
        }

        $route->param = $this->buildParam($route);

        $this->route = $route;
    }