From 1492370e4b455c3174838041b4c914007241ad91 Mon Sep 17 00:00:00 2001 From: Karsten Dambekalns Date: Fri, 17 Mar 2023 08:34:29 +0100 Subject: [PATCH] Remove type declaration using union type This restores PHP 7.4 compatibility Fixes #21 --- Classes/RepresentationSerializer.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Classes/RepresentationSerializer.php b/Classes/RepresentationSerializer.php index dc6e7ba..8bb1b84 100644 --- a/Classes/RepresentationSerializer.php +++ b/Classes/RepresentationSerializer.php @@ -37,7 +37,10 @@ public function __construct(Options $options, int $maxDepth = 3, ?string $mbDete $this->maxDepth = $maxDepth; } - protected function serializeObject($object, int $_depth = 0, array $hashes = []): array|float|bool|int|string|null + /** + * @return array|float|bool|int|string|null + */ + protected function serializeObject($object, int $_depth = 0, array $hashes = []) { if ($_depth >= $this->maxDepth || \in_array(spl_object_hash($object), $hashes, true)) { return $this->serializeValue($object);