From 9843328a1493cfc6bea1b8405af439dc72d7a529 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Tue, 19 Sep 2023 17:13:05 +0000 Subject: [PATCH] make getDataJson return array also for single values --- Message/RequestAbstract.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Message/RequestAbstract.php b/Message/RequestAbstract.php index f6b14bfb8..b9abc14ef 100755 --- a/Message/RequestAbstract.php +++ b/Message/RequestAbstract.php @@ -238,7 +238,11 @@ abstract class RequestAbstract implements MessageInterface $json = \json_decode($this->data[$key], true); /** @phpstan-ignore-line */ - return \is_array($json) ? $json : []; + if ($json === null) { + $json = $this->data[$key]; + } + + return \is_array($json) ? $json : [$json]; } /**