diff --git a/src/RouteCollector.php b/src/RouteCollector.php index c387f28..e1b0449 100644 --- a/src/RouteCollector.php +++ b/src/RouteCollector.php @@ -32,9 +32,12 @@ public function addRoute(Route|Group ...$routes): RouteCollectorInterface return $this; } - public function addProvider(RoutesProviderInterface $provider): RouteCollectorInterface + public function addProvider(RoutesProviderInterface ...$provider): RouteCollectorInterface { - $this->providers[] = $provider; + array_push( + $this->providers, + ...array_values($provider) + ); return $this; } diff --git a/src/RouteCollectorInterface.php b/src/RouteCollectorInterface.php index e9192b6..c64246d 100644 --- a/src/RouteCollectorInterface.php +++ b/src/RouteCollectorInterface.php @@ -16,7 +16,7 @@ public function addRoute(Route|Group ...$routes): self; /** * Add a provider of routes */ - public function addProvider(RoutesProviderInterface $provider): self; + public function addProvider(RoutesProviderInterface ...$provider): self; /** * Appends a handler middleware definition that should be invoked for a matched route.