| Conditions | 2 |
| Paths | 2 |
| Total Lines | 10 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 20 | public function __construct(MiddlewareInterface ...$middlewares) |
||
| 21 | { |
||
| 22 | $this->handler = new CallbackHandler(function () { |
||
| 23 | throw new DispatchException('unresolved request: middleware stack exhausted with no result'); |
||
| 24 | }); |
||
| 25 | |||
| 26 | foreach (array_reverse($middlewares) as $middleware) { |
||
| 27 | $inner = $this->handler; |
||
| 28 | $this->handler = new CallbackHandler(function (ServerRequestInterface $request) use ($middleware, $inner) { |
||
| 29 | return $middleware->process($request, $inner); |
||
| 30 | }); |
||
| 39 |