Skip to content

Commit

Permalink
Use variadic
Browse files Browse the repository at this point in the history
  • Loading branch information
rustamwin committed Oct 9, 2023
1 parent a132a19 commit 3828a27
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions src/RouteCollector.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
2 changes: 1 addition & 1 deletion src/RouteCollectorInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 3828a27

Please sign in to comment.