| Conditions | 2 |
| Paths | 1 |
| Total Lines | 13 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 39 | private function carry(): Closure |
||
| 40 | { |
||
| 41 | return static function (Closure $next, MiddlewareInterface|string $middleware): Closure { |
||
| 42 | return static function (Request $request) use ($next, $middleware): string { |
||
| 43 | if (is_string($middleware)) { |
||
| 44 | /** @var class-string<MiddlewareInterface> $middleware */ |
||
| 45 | /** @var MiddlewareInterface $instance */ |
||
| 46 | $instance = Container::create($middleware); |
||
| 47 | } else { |
||
| 48 | $instance = $middleware; |
||
| 49 | } |
||
| 50 | |||
| 51 | return $instance->handle($request, $next); |
||
| 52 | }; |
||
| 56 |