Conditions | 2 |
Paths | 2 |
Total Lines | 11 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php declare(strict_types=1); |
||
45 | public function post(ResponseInterface $response, array $options = []): CancellablePromiseInterface |
||
46 | { |
||
47 | if ($response->getBody() instanceof ReadableStreamInterface) { |
||
48 | return resolve($response); |
||
49 | } |
||
50 | |||
51 | return $this->jsonDecodeService->handle((string)$response->getBody())->then(function ($json) use ($response) { |
||
52 | $body = new JsonStream($json); |
||
53 | return resolve($response->withBody($body)); |
||
54 | }); |
||
55 | } |
||
56 | } |
||
57 |