From 829523c919fb8e65c17509909060f97e5073d8f5 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Wed, 9 Nov 2022 23:02:52 +0100 Subject: [PATCH] reduce serialization of null models --- Models/NullSession.php | 8 ++++++++ Models/NullSessionElement.php | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/Models/NullSession.php b/Models/NullSession.php index b0c21ee..2e08376 100755 --- a/Models/NullSession.php +++ b/Models/NullSession.php @@ -36,4 +36,12 @@ final class NullSession extends Session $this->id = $id; parent::__construct(); } + + /** + * {@inheritdoc} + */ + public function jsonSerialize() : mixed + { + return ['id' => $this->id]; + } } diff --git a/Models/NullSessionElement.php b/Models/NullSessionElement.php index ad84c39..0769365 100755 --- a/Models/NullSessionElement.php +++ b/Models/NullSessionElement.php @@ -36,4 +36,12 @@ final class NullSessionElement extends SessionElement $this->id = $id; parent::__construct(); } + + /** + * {@inheritdoc} + */ + public function jsonSerialize() : mixed + { + return ['id' => $this->id]; + } }