mirror of
https://github.com/retailcrm/mailgun-php.git
synced 2025-02-06 08:19:25 +03:00
Add new lines to improve readability
This commit is contained in:
parent
2c98efc519
commit
961ae177fa
@ -29,11 +29,13 @@ final class ModelHydrator implements Hydrator
|
|||||||
{
|
{
|
||||||
$body = $response->getBody()->__toString();
|
$body = $response->getBody()->__toString();
|
||||||
$contentType = $response->getHeaderLine('Content-Type');
|
$contentType = $response->getHeaderLine('Content-Type');
|
||||||
|
|
||||||
if (0 !== strpos($contentType, 'application/json') && 0 !== strpos($contentType, 'application/octet-stream')) {
|
if (0 !== strpos($contentType, 'application/json') && 0 !== strpos($contentType, 'application/octet-stream')) {
|
||||||
throw new HydrationException('The ModelHydrator cannot hydrate response with Content-Type: '.$contentType);
|
throw new HydrationException('The ModelHydrator cannot hydrate response with Content-Type: '.$contentType);
|
||||||
}
|
}
|
||||||
|
|
||||||
$data = json_decode($body, true);
|
$data = json_decode($body, true);
|
||||||
|
|
||||||
if (JSON_ERROR_NONE !== json_last_error()) {
|
if (JSON_ERROR_NONE !== json_last_error()) {
|
||||||
throw new HydrationException(sprintf('Error (%d) when trying to json_decode response', json_last_error()));
|
throw new HydrationException(sprintf('Error (%d) when trying to json_decode response', json_last_error()));
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user