| Conditions | 3 |
| Paths | 1 |
| Total Lines | 14 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 29 | 6 | public function __invoke(callable $handler): callable |
|
| 30 | { |
||
| 31 | 3 | return function (RequestInterface $request, array $options) use ($handler) { |
|
| 32 | 9 | $promise = $this->strategy->getPromise($request); |
|
| 33 | 9 | if ($promise instanceof PromiseInterface) { |
|
| 34 | 3 | return $promise; |
|
| 35 | } |
||
| 36 | |||
| 37 | 9 | if ($this->requestStorage) { |
|
| 38 | 3 | $this->strategy->storeRequest($request); |
|
| 39 | } |
||
| 40 | |||
| 41 | 9 | return $handler($request, $options)->then( |
|
| 42 | 9 | $this->onFulfilled($request) |
|
| 43 | ); |
||
| 61 |