Updates to vendors etc

This commit is contained in:
Chris Hunt
2025-07-11 15:57:48 +01:00
parent d972cbcd0a
commit 8fb6438254
8043 changed files with 248005 additions and 189479 deletions

View File

@@ -22,14 +22,16 @@ class RouteConfigurator
use Traits\HostTrait;
use Traits\RouteTrait;
protected $parentConfigurator;
public function __construct(RouteCollection $collection, RouteCollection $route, string $name = '', ?CollectionConfigurator $parentConfigurator = null, ?array $prefixes = null)
{
public function __construct(
RouteCollection $collection,
RouteCollection $route,
string $name = '',
protected ?CollectionConfigurator $parentConfigurator = null, // for GC control
?array $prefixes = null,
) {
$this->collection = $collection;
$this->route = $route;
$this->name = $name;
$this->parentConfigurator = $parentConfigurator; // for GC control
$this->prefixes = $prefixes;
}
@@ -42,7 +44,14 @@ class RouteConfigurator
*/
final public function host(string|array $host): static
{
$previousRoutes = clone $this->route;
$this->addHost($this->route, $host);
foreach ($previousRoutes as $name => $route) {
if (!$this->route->get($name)) {
$this->collection->remove($name);
}
}
$this->collection->addCollection($this->route);
return $this;
}