Skip to content

Commit

Permalink
Fix create response from empty array
Browse files Browse the repository at this point in the history
  • Loading branch information
Whyounes committed Dec 30, 2021
1 parent fbd1d44 commit 7f2a145
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/API/HTTPAdapter/CurlHTTPAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,6 @@ public function request(string $method, string $endpoint, array $params = [], ar

$responseBody = json_decode((string)$response, true);

return new Response($statusCode, !is_array($responseBody) ? $responseBody : []);
return new Response($statusCode, is_array($responseBody) ? $responseBody : []);
}
}
2 changes: 1 addition & 1 deletion src/API/HTTPAdapter/Guzzle67HTTPAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public function request(string $method, string $endpoint, array $params = [], ar

$responseBody = json_decode((string)$response->getBody(), true);

return new Response($response->getStatusCode(), !is_array($responseBody) ? $responseBody : []);
return new Response($response->getStatusCode(), is_array($responseBody) ? $responseBody : []);
}

private function assertSuccessResponsePayload(ResponseInterface $response): void
Expand Down

0 comments on commit 7f2a145

Please sign in to comment.