Skip to content

Commit 4741df6

Browse files
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.
1 parent adec8fd commit 4741df6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Api/Campaigns.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public function getForUser(): array
7171
if ($result->getStatusCode() !== 200) {
7272
throw new \Exception('API key or user invalid.', 1605878128);
7373
}
74-
$body = json_decode($result->getBody(), true);
74+
$body = json_decode((string) $result->getBody(), true);
7575
$campaigns = [];
7676
foreach ($body['Campaigns'] as $campaign) {
7777
$campaigns[] = new Campaign($campaign, $this->settings);

0 commit comments

Comments
 (0)