| Conditions | 2 |
| Paths | 2 |
| Total Lines | 11 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php declare(strict_types=1); |
||
| 37 | public function post(ResponseInterface $response, array $options = []): CancellablePromiseInterface |
||
| 38 | { |
||
| 39 | if ($response->getBody() instanceof ReadableStreamInterface) { |
||
| 40 | return resolve($response); |
||
| 41 | } |
||
| 42 | |||
| 43 | return $this->jsonDecodeService->handle((string)$response->getBody())->then(function ($json) use ($response) { |
||
| 44 | $body = new JsonStream($json); |
||
| 45 | return resolve($response->withBody($body)); |
||
| 46 | }); |
||
| 47 | } |
||
| 48 | } |
||
| 49 |