From fa7edb2c042d2e92196d625b50c1ba083b971720 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/NullReport.php | 8 ++++++++ Models/NullTemplate.php | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/Models/NullReport.php b/Models/NullReport.php index 3612e9a..8ef2ef6 100755 --- a/Models/NullReport.php +++ b/Models/NullReport.php @@ -36,4 +36,12 @@ final class NullReport extends Report $this->id = $id; parent::__construct(); } + + /** + * {@inheritdoc} + */ + public function jsonSerialize() : mixed + { + return ['id' => $this->id]; + } } diff --git a/Models/NullTemplate.php b/Models/NullTemplate.php index 0354b41..47d9c12 100755 --- a/Models/NullTemplate.php +++ b/Models/NullTemplate.php @@ -36,4 +36,12 @@ final class NullTemplate extends Template $this->id = $id; parent::__construct(); } + + /** + * {@inheritdoc} + */ + public function jsonSerialize() : mixed + { + return ['id' => $this->id]; + } }