mirror of
https://github.com/SkillDisplay/PHPToolKit.git
synced 2024-12-22 18:56:09 +01:00
Allow json decode of received campaigns response
The body is an instance of a stream. Therefore we need to cast so string before passing to json_decode. That's necessary because strict_types are forced.
This commit is contained in:
parent
adec8fd806
commit
4741df6803
1 changed files with 1 additions and 1 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue