public static function create(?TypeCollection $types = null): self
    {
        $types = $types ?? TypeCollection::createDefault();

        $parser = new Parser();

        $factory = new RouteFactory($parser, $types);

        return new self($factory);
    }
public static function create(?TypeCollection $types = null): self
    {
        $types = $types ?? TypeCollection::createDefault();

        $parser = new Parser();

        $factory = new RouteFactory($parser, $types);

        return new self($factory);
    }
public static function create ( ? TypeCollection $ types = null ) : self { $ types = $ types ?? TypeCollection :: createDefault ( ) ; $ parser = new Parser ( ) ; $ factory = new RouteFactory ( $ parser , $ types ) ; return new self ( $ factory ) ; }
Creates new empty route collection.

@param null|TypeCollection $types
@return RouteCollection
@throws InvalidTypes
Creates new empty route collection .