Total Complexity | 3 |
Total Lines | 32 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
12 | abstract class AbstractHydrator implements HydratorInterface |
||
13 | { |
||
14 | const HEADER_CONTENT_TYPE = 'Content-Type'; |
||
15 | |||
16 | /** |
||
17 | * @param \Psr\Http\Message\ResponseInterface $response Response to check. |
||
18 | * |
||
19 | * @return bool |
||
20 | */ |
||
21 | protected function isJsonResponse(ResponseInterface $response): bool |
||
22 | { |
||
23 | return 0 === \strpos($response->getHeaderLine(self::HEADER_CONTENT_TYPE), 'application/json'); |
||
24 | } |
||
25 | |||
26 | /** |
||
27 | * @param \Psr\Http\Message\ResponseInterface $response Response to parse. |
||
28 | * |
||
29 | * @return string |
||
30 | */ |
||
31 | protected function getBody(ResponseInterface $response): string |
||
34 | } |
||
35 | |||
36 | /** |
||
37 | * @param \Psr\Http\Message\ResponseInterface $response Response to parse. |
||
38 | * |
||
39 | * @return array|null |
||
40 | */ |
||
41 | protected function getBodyContent(ResponseInterface $response): ?array |
||
44 | } |
||
45 | } |
||
46 |