From 20b68e70cbe0967450a1915247a785fa77445aa8 Mon Sep 17 00:00:00 2001 From: Wouter Vanelslander Date: Thu, 23 Nov 2023 14:56:36 +0100 Subject: [PATCH 1/2] Lock jms/serializer at 3.24.0 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index ab46475..6f72281 100644 --- a/composer.json +++ b/composer.json @@ -25,7 +25,7 @@ "require": { "php": "^8", "guzzlehttp/guzzle": "^6.5.8|^7.4.5", - "jms/serializer": "^3.28", + "jms/serializer": "3.24.0", "simple-bus/jms-serializer-bridge": "^6.3.1" }, "require-dev": { From 55cc934ac73f4419ce5575a05dc97d61fec52b93 Mon Sep 17 00:00:00 2001 From: Wouter Vanelslander Date: Thu, 23 Nov 2023 15:52:29 +0100 Subject: [PATCH 2/2] Rewind body before fetching contents --- src/SearchClient.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/SearchClient.php b/src/SearchClient.php index 9551908..28b2fec 100644 --- a/src/SearchClient.php +++ b/src/SearchClient.php @@ -64,6 +64,9 @@ private function search(SearchQueryInterface $searchQuery, $type): PagedCollecti $result = $this->client->request('GET', $type, $options); - return $this->serializer->deserialize($result->getBody()->getContents()); + $body = $result->getBody(); + $body->rewind(); + + return $this->serializer->deserialize($body->getContents()); } }