private function findRoute(string $uri, string $method): RouteInterface
    {
        $matches = [];
        $route = new NullRoute();

        foreach ($this->routes as $value) {
            $urlMatch = \preg_match('`^'.\preg_replace($this->matchTypes, $this->types, $value->url).'/?$`', $uri, $matches);
            $methodMatch = \strpos($value->method, $method);

            if ($urlMatch && $methodMatch !== false) {
                $route = clone $value;
                $this->routeMatches = $matches;
                break;
            }
        }

        return $route;
    }
private function findRoute(string $uri, string $method): RouteInterface
    {
        $matches = [];
        $route = new NullRoute();

        foreach ($this->routes as $value) {
            $urlMatch = \preg_match('`^'.\preg_replace($this->matchTypes, $this->types, $value->url).'/?$`', $uri, $matches);
            $methodMatch = \strpos($value->method, $method);

            if ($urlMatch && $methodMatch !== false) {
                $route = clone $value;
                $this->routeMatches = $matches;
                break;
            }
        }

        return $route;
    }
private function findRoute ( string $ uri , string $ method ) : RouteInterface { $ matches = [ ] ; $ route = new NullRoute ( ) ; foreach ( $ this -> routes as $ value ) { $ urlMatch = \ preg_match ( '`^' . \ preg_replace ( $ this -> matchTypes , $ this -> types , $ value -> url ) . '/?$`' , $ uri , $ matches ) ; $ methodMatch = \ strpos ( $ value -> method , $ method ) ; if ( $ urlMatch && $ methodMatch !== false ) { $ route = clone $ value ; $ this -> routeMatches = $ matches ; break ; } } return $ route ; }
Find if provided route match with one of registered routes.

@param string $uri
@param string $method

@return RouteInterface
Find if provided route match with one of registered routes .