From 01fbc43de8c330e8b8dc5766525e6187afb0dccb 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/NullContact.php | 8 ++++++++ Models/NullContactElement.php | 8 ++++++++ Models/NullProfile.php | 8 ++++++++ 3 files changed, 24 insertions(+) diff --git a/Models/NullContact.php b/Models/NullContact.php index e7886be..91babfe 100755 --- a/Models/NullContact.php +++ b/Models/NullContact.php @@ -36,4 +36,12 @@ final class NullContact extends Contact $this->id = $id; parent::__construct(); } + + /** + * {@inheritdoc} + */ + public function jsonSerialize() : mixed + { + return ['id' => $this->id]; + } } diff --git a/Models/NullContactElement.php b/Models/NullContactElement.php index 1c4110d..2ef5c65 100755 --- a/Models/NullContactElement.php +++ b/Models/NullContactElement.php @@ -35,4 +35,12 @@ final class NullContactElement extends ContactElement { $this->id = $id; } + + /** + * {@inheritdoc} + */ + public function jsonSerialize() : mixed + { + return ['id' => $this->id]; + } } diff --git a/Models/NullProfile.php b/Models/NullProfile.php index 90e805f..32e9b49 100755 --- a/Models/NullProfile.php +++ b/Models/NullProfile.php @@ -36,4 +36,12 @@ final class NullProfile extends Profile $this->id = $id; parent::__construct(); } + + /** + * {@inheritdoc} + */ + public function jsonSerialize() : mixed + { + return ['id' => $this->id]; + } }