From cfd1beafeba7152d08ed494b8d9167c8e677fcb9 Mon Sep 17 00:00:00 2001 From: tuutti Date: Thu, 28 Sep 2023 07:54:39 +0300 Subject: [PATCH] Make sure PubSub message is a string --- src/Azure/PubSub/PubSubManager.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Azure/PubSub/PubSubManager.php b/src/Azure/PubSub/PubSubManager.php index e940ca57..272740d1 100644 --- a/src/Azure/PubSub/PubSubManager.php +++ b/src/Azure/PubSub/PubSubManager.php @@ -61,7 +61,7 @@ private function joinGroup() : void { try { // Wait until we've actually joined the group. - $message = $this->decodeMessage($this->client->receive()); + $message = $this->decodeMessage((string) $this->client->receive()); if (isset($message['event']) && $message['event'] === 'connected') { $this->joinedGroup = TRUE; @@ -157,8 +157,8 @@ public function sendMessage(array $message) : self { public function receive() : string { $this->assertSettings() ->joinGroup(); - $message = $this->client->receive(); - $json = json_decode($message, TRUE, flags: JSON_THROW_ON_ERROR); + $message = (string) $this->client->receive(); + $json = $this->decodeMessage($message); $this->eventDispatcher ->dispatch(new PubSubMessage($json));