From 973dbedd53d8a93ba9a786ca1bb78002db3d90d5 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/NullDashboardBoard.php | 8 ++++++++ Models/NullDashboardComponent.php | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/Models/NullDashboardBoard.php b/Models/NullDashboardBoard.php index 55a2626..9ea74b1 100755 --- a/Models/NullDashboardBoard.php +++ b/Models/NullDashboardBoard.php @@ -35,4 +35,12 @@ final class NullDashboardBoard extends DashboardBoard { $this->id = $id; } + + /** + * {@inheritdoc} + */ + public function jsonSerialize() : mixed + { + return ['id' => $this->id]; + } } diff --git a/Models/NullDashboardComponent.php b/Models/NullDashboardComponent.php index 7fbe49c..6e6f141 100755 --- a/Models/NullDashboardComponent.php +++ b/Models/NullDashboardComponent.php @@ -35,4 +35,12 @@ final class NullDashboardComponent extends DashboardComponent { $this->id = $id; } + + /** + * {@inheritdoc} + */ + public function jsonSerialize() : mixed + { + return ['id' => $this->id]; + } }