Skip to content

Commit

Permalink
make getDataJson return array also for single values
Browse files Browse the repository at this point in the history
  • Loading branch information
Dennis Eichhorn committed Sep 19, 2023
1 parent 11d2ed8 commit 9843328
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Message/RequestAbstract.php
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,11 @@ public function getDataJson(string $key) : array

$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];
}

/**
Expand Down

0 comments on commit 9843328

Please sign in to comment.