public function build()
    {
        $uri = $this->trimTrailingSlashes($this->request->getUri()->getPath());
        $method = mb_strtoupper($this->request->getMethod());

        foreach ($this->routes[$method] as $routeUri => $action) {
            $arguments = $this->match($uri, $routeUri);

            if (!is_null($arguments)) {
                return $this->constructAction($action, $arguments);
            }
        }

        throw new HTTPException('Not found', 404);
    }
public function build()
    {
        $uri = $this->trimTrailingSlashes($this->request->getUri()->getPath());
        $method = mb_strtoupper($this->request->getMethod());

        foreach ($this->routes[$method] as $routeUri => $action) {
            $arguments = $this->match($uri, $routeUri);

            if (!is_null($arguments)) {
                return $this->constructAction($action, $arguments);
            }
        }

        throw new HTTPException('Not found', 404);
    }
public function build ( ) { $ uri = $ this -> trimTrailingSlashes ( $ this -> request -> getUri ( ) -> getPath ( ) ) ; $ method = mb_strtoupper ( $ this -> request -> getMethod ( ) ) ; foreach ( $ this -> routes [ $ method ] as $ routeUri => $ action ) { $ arguments = $ this -> match ( $ uri , $ routeUri ) ; if ( ! is_null ( $ arguments ) ) { return $ this -> constructAction ( $ action , $ arguments ) ; } } throw new HTTPException ( 'Not found' , 404 ) ; }
Handle the route.

@throws \Shorty\Framework\Routing\Exceptions\HTTPException

@return bool
Handle the route .