From e5bc4dc4493feabb971a30bdae33c9a19c873a12 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/NullWikiApp.php | 8 ++++++++ Models/NullWikiCategory.php | 8 ++++++++ Models/NullWikiDoc.php | 8 ++++++++ Models/NullWikiDocHistory.php | 8 ++++++++ 4 files changed, 32 insertions(+) diff --git a/Models/NullWikiApp.php b/Models/NullWikiApp.php index 96353a1..747d1dc 100755 --- a/Models/NullWikiApp.php +++ b/Models/NullWikiApp.php @@ -35,4 +35,12 @@ final class NullWikiApp extends WikiApp { $this->id = $id; } + + /** + * {@inheritdoc} + */ + public function jsonSerialize() : mixed + { + return ['id' => $this->id]; + } } diff --git a/Models/NullWikiCategory.php b/Models/NullWikiCategory.php index 2aefc07..440a04e 100755 --- a/Models/NullWikiCategory.php +++ b/Models/NullWikiCategory.php @@ -35,4 +35,12 @@ final class NullWikiCategory extends WikiCategory { $this->id = $id; } + + /** + * {@inheritdoc} + */ + public function jsonSerialize() : mixed + { + return ['id' => $this->id]; + } } diff --git a/Models/NullWikiDoc.php b/Models/NullWikiDoc.php index 4ec0a1b..adb4eaf 100755 --- a/Models/NullWikiDoc.php +++ b/Models/NullWikiDoc.php @@ -35,4 +35,12 @@ final class NullWikiDoc extends WikiDoc { $this->id = $id; } + + /** + * {@inheritdoc} + */ + public function jsonSerialize() : mixed + { + return ['id' => $this->id]; + } } diff --git a/Models/NullWikiDocHistory.php b/Models/NullWikiDocHistory.php index cf891af..8ffa1ee 100755 --- a/Models/NullWikiDocHistory.php +++ b/Models/NullWikiDocHistory.php @@ -35,4 +35,12 @@ final class NullWikiDocHistory extends WikiDocHistory { $this->id = $id; } + + /** + * {@inheritdoc} + */ + public function jsonSerialize() : mixed + { + return ['id' => $this->id]; + } }