Merge pull request #8 from DanielSiepmann/bugfix/type-missmatch-for-campaigns-api

Allow json decode of received campaigns response
This commit is contained in:
Markus Klein 2021-01-22 22:07:20 +01:00 committed by GitHub
commit 2977ee8781
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -71,7 +71,7 @@ class Campaigns
if ($result->getStatusCode() !== 200) {
throw new \Exception('API key or user invalid.', 1605878128);
}
$body = json_decode($result->getBody(), true);
$body = json_decode((string) $result->getBody(), true);
$campaigns = [];
foreach ($body['Campaigns'] as $campaign) {
$campaigns[] = new Campaign($campaign, $this->settings);