Total Complexity | 7 |
Total Lines | 47 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
10 | class GuzzleResponse implements HttpClientResponse |
||
11 | { |
||
12 | use NeedsParseHeaders; |
||
13 | |||
14 | protected ResponseInterface $response; |
||
15 | |||
16 | 13 | public function __construct(ResponseInterface $response) |
|
17 | { |
||
18 | 13 | $this->response = $response; |
|
19 | 13 | } |
|
20 | |||
21 | 5 | public function getStatusCode(): int |
|
22 | { |
||
23 | 5 | return $this->response->getStatusCode(); |
|
24 | } |
||
25 | |||
26 | 1 | public function getHeaders(): array |
|
27 | { |
||
28 | 1 | return $this->parseHeaders($this->response->getHeaders()); |
|
29 | } |
||
30 | |||
31 | 1 | public function getBody(): string |
|
32 | { |
||
33 | 1 | return $this->toString(); |
|
34 | } |
||
35 | |||
36 | 11 | public function parseJson(): array |
|
49 | } |
||
50 | |||
51 | 12 | private function toString(): string |
|
52 | { |
||
53 | 12 | $stream = $this->response->getBody(); |
|
59 |