Skip to content

Commit

Permalink
Turn on strict typing and fix accordingly
Browse files Browse the repository at this point in the history
  • Loading branch information
sfreytag committed Jul 17, 2024
1 parent 7218d16 commit 529a045
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/ApiClient.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
<?php
<?php declare(strict_types=1);

namespace CloudForest;

use Exception;
use Illuminate\Http\Client\RequestException;
use GuzzleHttp\Client;
use GuzzleHttp\Exception\GuzzleException;

Expand Down Expand Up @@ -310,7 +309,7 @@ public function exchange($tempToken)
throw $e;
}

$body = $response->getBody();
$body = $response->getBody()->getContents();
$content = json_decode($body, true);
$data = $this->getDataAsArray($content);
if (array_key_exists('access', $data) && array_key_exists('refresh', $data) && is_string($data['access']) && is_string($data['refresh'])) {
Expand Down Expand Up @@ -362,7 +361,7 @@ public function create(ListingDto $listing)
throw $e;
}

$body = $response->getBody();
$body = $response->getBody()->getContents();
$content = json_decode($body, true);
$data = $this->getDataAsArray($content);

Expand Down Expand Up @@ -406,7 +405,7 @@ public function create(ListingDto $listing)
throw $e;
}

$body = $response->getBody();
$body = $response->getBody()->getContents();
$content = json_decode($body, true);
$data = $this->getDataAsString($content);
return $data;
Expand Down Expand Up @@ -480,7 +479,7 @@ public function refresh(string $refresh)
throw $e;
}

$body = $response->getBody();
$body = $response->getBody()->getContents();
$content = json_decode($body, true);
$data = $this->getDataAsArray($content);
return $data;
Expand Down

0 comments on commit 529a045

Please sign in to comment.