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