diff --git a/src/Node.php b/src/Node.php index 1c16e55..1971f65 100644 --- a/src/Node.php +++ b/src/Node.php @@ -128,7 +128,10 @@ public function getIterator(): PreOrderTraversal return new PreOrderTraversal($this); } - public function jsonSerialize(): array + /** + * @return mixed Intentionally returns mixed and not an array, so that overriding implementations may expand it to whatever value desired. + */ + public function jsonSerialize(): mixed { return [ 'data' => $this->data(),