protected function findRoute(int $method, string $uri)
    {
        $route = null;
        // if URI is empty and a default route is set, use it instead
        if ($uri !== ""
            || ($route = $this->routes->defaultRoute()) === null
        ) {
            return $this->checkContainer($method, $uri);
        }
        return $route;
    }
protected function findRoute(int $method, string $uri)
    {
        $route = null;
        // if URI is empty and a default route is set, use it instead
        if ($uri !== ""
            || ($route = $this->routes->defaultRoute()) === null
        ) {
            return $this->checkContainer($method, $uri);
        }
        return $route;
    }
protected function findRoute ( int $ method , string $ uri ) { $ route = null ; // if URI is empty and a default route is set, use it instead if ( $ uri !== "" || ( $ route = $ this -> routes -> defaultRoute ( ) ) === null ) { return $ this -> checkContainer ( $ method , $ uri ) ; } return $ route ; }
Find matching Route

Try and obtain the route that bests fits the request and return it. If no
such route is found, and no 404 route exists, nor is one returned from a
'routeNotFound' hook execution, null is returned.

@param int $method Request Method
@param string $uri Request Uri
@return \SlaxWeb\Router\Route|null
Find matching Route