Skip to content

Commit

Permalink
Fixed Dispatcher add() signature
Browse files Browse the repository at this point in the history
Signed-off-by: Tom Wright <tom@inflatablecookie.com>
  • Loading branch information
betterthanclay committed Dec 11, 2023
1 parent 74b3766 commit 653c1a6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
* Fixed Dispatcher add() signature

## v0.2.14 (2023-12-11)
* Added message body getter helpers
* Improved JSON error handling
Expand Down
4 changes: 3 additions & 1 deletion src/Dispatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ public function handle(
/**
* Add middleware to stack
*
* @param string|class-string<Middleware>|Middleware|Stage|Closure(Request, Handler):Response|array<string|class-string<Middleware>|Middleware|Closure(Request, Handler):Response> ...$middlewares
* @param string|class-string<Middleware>|Middleware|Stage|Closure(Request, Handler):Response|array<mixed> ...$middlewares
*
* @return $this
*/
Expand All @@ -199,9 +199,11 @@ public function add(
$this->add(new DeferredStage(
type: $key,
container: $this->container,
/** @var array<string, mixed> $middleware */
parameters: $middleware
));
} else {
/** @var array<int,string|class-string<Middleware>|Middleware|Stage|Closure(Request, Handler):Response>|array<string,array<mixed>> $middleware */
$this->add(...$middleware);
}

Expand Down

0 comments on commit 653c1a6

Please sign in to comment.