src/Routing/RouteCollection.php
public function match($url, $redirect404 = true)
    {
        $routeFound = null;

        foreach ($this->routes as $route) {
            if (!$route->verify($url)) {
                continue;
            }

            $routeFound = $route;
            break;
        }

        if (!($routeFound instanceof RouteInterface) && $redirect404 === true) {
            $routeFound = $this->get('error404');
        }

        return $routeFound;
    }
public function match($url, $redirect404 = true)
    {
        $routeFound = null;

        foreach ($this->routes as $route) {
            if (!$route->verify($url)) {
                continue;
            }

            $routeFound = $route;
            break;
        }

        if (!($routeFound instanceof RouteInterface) && $redirect404 === true) {
            $routeFound = $this->get('error404');
        }

        return $routeFound;
    }
public function match ( $ url , $ redirect404 = true ) { $ routeFound = null ; foreach ( $ this -> routes as $ route ) { if ( ! $ route -> verify ( $ url ) ) { continue ; } $ routeFound = $ route ; break ; } if ( ! ( $ routeFound instanceof RouteInterface ) && $ redirect404 === true ) { $ routeFound = $ this -> get ( 'error404' ) ; } return $ routeFound ; }
Try to find a route that match the specified url.

@param  string $url
@param  bool   $redirect404
@return Route|null
@throws \Exception
Try to find a route that match the specified url .