public function populateCollection(RouteCollection $routes): RouteCollection
    {
        foreach ($this->items as $route) {
            if ($route instanceof self) {
                $route->populateCollection($routes);
            } else {
                $routes->add(...$route);
            }
        }

        return $routes;
    }
public function populateCollection(RouteCollection $routes): RouteCollection
    {
        foreach ($this->items as $route) {
            if ($route instanceof self) {
                $route->populateCollection($routes);
            } else {
                $routes->add(...$route);
            }
        }

        return $routes;
    }
public function populateCollection ( RouteCollection $ routes ) : RouteCollection { foreach ( $ this -> items as $ route ) { if ( $ route instanceof self ) { $ route -> populateCollection ( $ routes ) ; } else { $ routes -> add ( ... $ route ) ; } } return $ routes ; }
Linearizes back a set of nested routes into a collection.
Linearizes back a set of nested routes into a collection .