| Conditions | 4 |
| Paths | 4 |
| Total Lines | 18 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 24 | public function addStack(iterable $middlewareStack):QueueDispatcher{ |
||
| 25 | |||
| 26 | foreach($middlewareStack as $middleware){ |
||
| 27 | |||
| 28 | if(!$middleware instanceof MiddlewareInterface){ |
||
| 29 | throw new MiddlewareException('invalid middleware'); |
||
| 30 | } |
||
| 31 | |||
| 32 | if(!$middleware instanceof PriorityMiddlewareInterface){ |
||
| 33 | $middleware = new PriorityMiddleware($middleware); |
||
| 34 | } |
||
| 35 | |||
| 36 | $this->middlewareStack[] = $middleware; |
||
| 37 | } |
||
| 38 | |||
| 39 | $this->sortMiddleware(); |
||
| 40 | |||
| 41 | return $this; |
||
| 42 | } |
||
| 71 |