From 7699a7d16da7d31626cadaa2bf379c65ed909e90 Mon Sep 17 00:00:00 2001 From: zyimm Date: Sun, 20 Aug 2023 13:52:33 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B6=88=E6=81=AF=E4=BD=93=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E5=8E=9F=E5=A7=8Bjson=E5=AF=B9=E8=B1=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/consumer/message/Message.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/consumer/message/Message.php b/src/consumer/message/Message.php index 6ec9b36..9c3667a 100644 --- a/src/consumer/message/Message.php +++ b/src/consumer/message/Message.php @@ -20,11 +20,11 @@ class Message } /** - * @param string $message_body + * @param mixed $message_body */ - public function setMessageBody(string $message_body): void + public function setMessageBody($message_body): void { - $this->messageBody = json_decode($message_body, true); + $this->messageBody = is_array($message_body) ? $message_body : json_decode($message_body, true); } /** @@ -68,7 +68,7 @@ class Message } /** - * @param string $messageId + * @param string $messageId */ public function setMessageId(string $messageId): void {