protected function dispatch(): Response
    {
        $httpMethod = $this->request->getRequestMethod();
        $uri = $this->request->getRequestUri();
        $routeInfo = $this->router->dispatch($httpMethod, $uri);
        if (!isset($routeInfo[0])) {
            throw new BadRequestException('Unable to parse request.');
        }
        switch ($routeInfo[0]) {
            case Router::NOT_FOUND:
                throw new NotFoundException('Page not found.');
            case Router::METHOD_NOT_ALLOWED:
                throw new MethodNotAllowedException('Method not allowed');
            case Router::FOUND:
                $action = $routeInfo[1];
                $arguments = $routeInfo[2];
                return $this->callAction($action, $arguments);
            default:
                throw new BadRequestException('Unable to parse request.');
        }
    }
protected function dispatch(): Response
    {
        $httpMethod = $this->request->getRequestMethod();
        $uri = $this->request->getRequestUri();
        $routeInfo = $this->router->dispatch($httpMethod, $uri);
        if (!isset($routeInfo[0])) {
            throw new BadRequestException('Unable to parse request.');
        }
        switch ($routeInfo[0]) {
            case Router::NOT_FOUND:
                throw new NotFoundException('Page not found.');
            case Router::METHOD_NOT_ALLOWED:
                throw new MethodNotAllowedException('Method not allowed');
            case Router::FOUND:
                $action = $routeInfo[1];
                $arguments = $routeInfo[2];
                return $this->callAction($action, $arguments);
            default:
                throw new BadRequestException('Unable to parse request.');
        }
    }
protected function dispatch ( ) : Response { $ httpMethod = $ this -> request -> getRequestMethod ( ) ; $ uri = $ this -> request -> getRequestUri ( ) ; $ routeInfo = $ this -> router -> dispatch ( $ httpMethod , $ uri ) ; if ( ! isset ( $ routeInfo [ 0 ] ) ) { throw new BadRequestException ( 'Unable to parse request.' ) ; } switch ( $ routeInfo [ 0 ] ) { case Router :: NOT_FOUND : throw new NotFoundException ( 'Page not found.' ) ; case Router :: METHOD_NOT_ALLOWED : throw new MethodNotAllowedException ( 'Method not allowed' ) ; case Router :: FOUND : $ action = $ routeInfo [ 1 ] ; $ arguments = $ routeInfo [ 2 ] ; return $ this -> callAction ( $ action , $ arguments ) ; default : throw new BadRequestException ( 'Unable to parse request.' ) ; } }
Analyzes the request using the router and calls corresponding action.
Throws HTTP exceptions in case request could not be assigned to an action.

@throws BadRequestException
@throws MethodNotAllowedException
@throws NotFoundException
@throws EndocoreException
@return Response
Analyzes the request using the router and calls corresponding action . Throws HTTP exceptions in case request could not be assigned to an action .