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