public static function create(RouteCollection $routes): self
    {
        $factory = new PathPatternFactory();
        $compiler = new MultiPatternCompiler($factory);

        return new self($routes, $compiler);
    }
public static function create(RouteCollection $routes): self
    {
        $factory = new PathPatternFactory();
        $compiler = new MultiPatternCompiler($factory);

        return new self($routes, $compiler);
    }
public static function create ( RouteCollection $ routes ) : self { $ factory = new PathPatternFactory ( ) ; $ compiler = new MultiPatternCompiler ( $ factory ) ; return new self ( $ routes , $ compiler ) ; }
Creates new router for given routes.

@param RouteCollection $routes
@return Router
Creates new router for given routes .