src/Hydrator/ArrayHydrator.php 1 location
|
@@ 25-27 (lines=3) @@
|
22 |
|
public function hydrate(ResponseInterface $response, string $class): array |
23 |
|
{ |
24 |
|
$body = $response->getBody()->__toString(); |
25 |
|
if (0 !== \mb_strpos($response->getHeaderLine('Content-Type'), 'application/json')) { |
26 |
|
throw new HydrationException('The ArrayHydrator cannot hydrate response with Content-Type:'.$response->getHeaderLine('Content-Type')); |
27 |
|
} |
28 |
|
|
29 |
|
$content = \json_decode($body, true); |
30 |
|
if (\JSON_ERROR_NONE !== \json_last_error()) { |
src/Hydrator/ModelHydrator.php 1 location
|
@@ 26-28 (lines=3) @@
|
23 |
|
public function hydrate(ResponseInterface $response, string $class) |
24 |
|
{ |
25 |
|
$body = $response->getBody()->__toString(); |
26 |
|
if (0 !== \mb_strpos($response->getHeaderLine('Content-Type'), 'application/json')) { |
27 |
|
throw new HydrationException('The ModelHydrator cannot hydrate response with Content-Type:'.$response->getHeaderLine('Content-Type')); |
28 |
|
} |
29 |
|
|
30 |
|
$data = \json_decode($body, true); |
31 |
|
if (\JSON_ERROR_NONE !== \json_last_error()) { |