From 53f95ed9628713d2cafb734d6491505674c410ee 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/NullContract.php | 8 ++++++++ Models/NullContractType.php | 8 ++++++++ Models/NullContractTypeL11n.php | 8 ++++++++ 3 files changed, 24 insertions(+) diff --git a/Models/NullContract.php b/Models/NullContract.php index 93694fb..3f81f8c 100755 --- a/Models/NullContract.php +++ b/Models/NullContract.php @@ -36,4 +36,12 @@ final class NullContract extends Contract $this->id = $id; parent::__construct(); } + + /** + * {@inheritdoc} + */ + public function jsonSerialize() : mixed + { + return ['id' => $this->id]; + } } diff --git a/Models/NullContractType.php b/Models/NullContractType.php index 9a75955..36a652d 100755 --- a/Models/NullContractType.php +++ b/Models/NullContractType.php @@ -36,4 +36,12 @@ final class NullContractType extends ContractType $this->id = $id; parent::__construct(); } + + /** + * {@inheritdoc} + */ + public function jsonSerialize() : mixed + { + return ['id' => $this->id]; + } } diff --git a/Models/NullContractTypeL11n.php b/Models/NullContractTypeL11n.php index d232979..4e42cb9 100755 --- a/Models/NullContractTypeL11n.php +++ b/Models/NullContractTypeL11n.php @@ -36,4 +36,12 @@ final class NullContractTypeL11n extends ContractTypeL11n $this->id = $id; parent::__construct(); } + + /** + * {@inheritdoc} + */ + public function jsonSerialize() : mixed + { + return ['id' => $this->id]; + } }