消息体支持原始json对象

This commit is contained in:
zyimm 2023-08-20 13:52:33 +08:00
parent ff5d7f4e3c
commit 7699a7d16d

View File

@ -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);
}
/**