src/Routing/Router.php
public function dispatch(Request $request)
    {
        $pathInfo = $request->getPathInfo();
        $method   = $request->getMethod();

        $route = $this->collection->find($method, $pathInfo);

        if ( ! $route) {
            throw new \Exception('Route not found !');
        }

        return $this->dispatcher->dispatch($route);
    }
public function dispatch(Request $request)
    {
        $pathInfo = $request->getPathInfo();
        $method   = $request->getMethod();

        $route = $this->collection->find($method, $pathInfo);

        if ( ! $route) {
            throw new \Exception('Route not found !');
        }

        return $this->dispatcher->dispatch($route);
    }
public function dispatch ( Request $ request ) { $ pathInfo = $ request -> getPathInfo ( ) ; $ method = $ request -> getMethod ( ) ; $ route = $ this -> collection -> find ( $ method , $ pathInfo ) ; if ( ! $ route ) { throw new \ Exception ( 'Route not found !' ) ; } return $ this -> dispatcher -> dispatch ( $ route ) ; }
For a specific method and uri, dispatch the route.

@param Request $request
@return bool
@throws \Exception
For a specific method and uri dispatch the route .