From 59a4a3271cab83db7a44f08aebfb41b61cb84ee9 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/NullAccount.php | 8 ++++++++ Models/NullAccountPermission.php | 8 ++++++++ Models/NullAddress.php | 8 ++++++++ Models/NullGroup.php | 8 ++++++++ Models/NullGroupPermission.php | 8 ++++++++ Models/NullModule.php | 8 ++++++++ 6 files changed, 48 insertions(+) diff --git a/Models/NullAccount.php b/Models/NullAccount.php index fee3f6c..e90e5bc 100755 --- a/Models/NullAccount.php +++ b/Models/NullAccount.php @@ -36,4 +36,12 @@ final class NullAccount extends Account parent::__construct(); $this->id = $id; } + + /** + * {@inheritdoc} + */ + public function jsonSerialize() : mixed + { + return ['id' => $this->id]; + } } diff --git a/Models/NullAccountPermission.php b/Models/NullAccountPermission.php index 785b922..296b17e 100755 --- a/Models/NullAccountPermission.php +++ b/Models/NullAccountPermission.php @@ -36,4 +36,12 @@ final class NullAccountPermission extends AccountPermission $this->id = $id; parent::__construct(); } + + /** + * {@inheritdoc} + */ + public function jsonSerialize() : mixed + { + return ['id' => $this->id]; + } } diff --git a/Models/NullAddress.php b/Models/NullAddress.php index cd95226..01ab4da 100755 --- a/Models/NullAddress.php +++ b/Models/NullAddress.php @@ -35,4 +35,12 @@ final class NullAddress extends Address { $this->id = $id; } + + /** + * {@inheritdoc} + */ + public function jsonSerialize() : mixed + { + return ['id' => $this->id]; + } } diff --git a/Models/NullGroup.php b/Models/NullGroup.php index bb6c77d..5439f2a 100755 --- a/Models/NullGroup.php +++ b/Models/NullGroup.php @@ -36,4 +36,12 @@ final class NullGroup extends Group $this->id = $id; parent::__construct(); } + + /** + * {@inheritdoc} + */ + public function jsonSerialize() : mixed + { + return ['id' => $this->id]; + } } diff --git a/Models/NullGroupPermission.php b/Models/NullGroupPermission.php index ba0d02f..d591440 100755 --- a/Models/NullGroupPermission.php +++ b/Models/NullGroupPermission.php @@ -36,4 +36,12 @@ final class NullGroupPermission extends GroupPermission $this->id = $id; parent::__construct(); } + + /** + * {@inheritdoc} + */ + public function jsonSerialize() : mixed + { + return ['id' => $this->id]; + } } diff --git a/Models/NullModule.php b/Models/NullModule.php index 602c1d2..b1d24c0 100755 --- a/Models/NullModule.php +++ b/Models/NullModule.php @@ -36,4 +36,12 @@ final class NullModule extends Module parent::__construct(); $this->id = $id; } + + /** + * {@inheritdoc} + */ + public function jsonSerialize() : mixed + { + return ['id' => $this->id]; + } }