diff --git a/src/Value/DecodedJson/NodeValueFactory.php b/src/Value/DecodedJson/NodeValueFactory.php index 33f7c15..2eb6209 100644 --- a/src/Value/DecodedJson/NodeValueFactory.php +++ b/src/Value/DecodedJson/NodeValueFactory.php @@ -29,8 +29,8 @@ public function createValue(mixed $data, ?PathInterface $path = null): NodeValue return match (true) { null === $data, is_scalar($data) => new NodeScalarValue($data, $path), + is_object($data) || (is_array($data) && !array_is_list($data)) => new NodeObjectValue((object)$data, $path, $this), is_array($data) => new NodeArrayValue($data, $path, $this), - is_object($data) => new NodeObjectValue($data, $path, $this), default => throw new Exception\InvalidNodeDataException($data, $path), }; }