protected function findRoute(Request $request)
    {
        if (! in_array($request->method(), array('GET', 'HEAD', 'OPTIONS'))) {
            return;
        }

        $uri = $request->path();

        foreach ($this->routes as $pattern => $callback) {
            if (preg_match('#^' .$pattern .'$#s', $uri, $matches)) {
                return array($callback, array_slice($matches, 1));
            }
        }
    }
protected function findRoute(Request $request)
    {
        if (! in_array($request->method(), array('GET', 'HEAD', 'OPTIONS'))) {
            return;
        }

        $uri = $request->path();

        foreach ($this->routes as $pattern => $callback) {
            if (preg_match('#^' .$pattern .'$#s', $uri, $matches)) {
                return array($callback, array_slice($matches, 1));
            }
        }
    }
protected function findRoute ( Request $ request ) { if ( ! in_array ( $ request -> method ( ) , array ( 'GET' , 'HEAD' , 'OPTIONS' ) ) ) { return ; } $ uri = $ request -> path ( ) ; foreach ( $ this -> routes as $ pattern => $ callback ) { if ( preg_match ( '#^' . $ pattern . '$#s' , $ uri , $ matches ) ) { return array ( $ callback , array_slice ( $ matches , 1 ) ) ; } } }
Dispatch an URI and return the associated file path.

@param  string  $uri
@return string|null
Dispatch an URI and return the associated file path .