Skip to content

Commit

Permalink
Node's return type expanded
Browse files Browse the repository at this point in the history
  • Loading branch information
dakujem committed Jan 14, 2024
1 parent ee88816 commit a8a0588
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Node.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down

0 comments on commit a8a0588

Please sign in to comment.