| Conditions | 3 |
| Paths | 3 |
| Total Lines | 20 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 10 |
| CRAP Score | 3 |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 22 | 2 | public function resolve(mixed $argument): array |
|
| 23 | { |
||
| 24 | /** @psalm-suppress RedundantPropertyInitializationCheck */ |
||
| 25 | 2 | if (! isset($this->queue)) { |
|
| 26 | 1 | throw new NextHandlerIsEmptyException('Cannot invoke pipeline resolver more than once'); |
|
| 27 | } |
||
| 28 | |||
| 29 | 2 | if ($this->queue->isEmpty()) { |
|
| 30 | 1 | unset($this->queue); |
|
| 31 | |||
| 32 | 1 | return $this->fallbackResolver->resolve($argument); |
|
| 33 | } |
||
| 34 | |||
| 35 | /** @var MiddlewareInterface $middleware */ |
||
| 36 | 1 | $middleware = $this->queue->extract(); |
|
| 37 | |||
| 38 | 1 | $next = clone $this; |
|
| 39 | 1 | unset($this->queue); |
|
| 40 | |||
| 41 | 1 | return $middleware->process($argument, $next); |
|
| 42 | } |
||
| 44 |