From b7e18bfd59076b52ba2614b923798f679d127120 Mon Sep 17 00:00:00 2001 From: Justin Norton Date: Thu, 17 Nov 2022 10:41:20 +0000 Subject: [PATCH] Fix PHP8.1 deprecation messages. --- src/ApiRequester.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/ApiRequester.php b/src/ApiRequester.php index e4240e8..40114ef 100644 --- a/src/ApiRequester.php +++ b/src/ApiRequester.php @@ -78,8 +78,9 @@ public function response(ResponseInterface $response) $data = $decoded; if (!empty($decoded)) { - reset($decoded); - $data = current($decoded); // get first attribute from array, e.g.: subscription, subscriptions, errors. + $decoded_array = (array) $decoded; + reset($decoded_array); + $data = (object) current($decoded_array); // get first attribute from array, e.g.: subscription, subscriptions, errors. } $this->checkRateLimit($response)