From a813e1677a3d34627bd396af295ab1f025d464d3 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/NullBill.php | 8 ++++++++ Models/NullBillElement.php | 8 ++++++++ Models/NullBillType.php | 8 ++++++++ 3 files changed, 24 insertions(+) diff --git a/Models/NullBill.php b/Models/NullBill.php index 89a5b22..0fce6ea 100755 --- a/Models/NullBill.php +++ b/Models/NullBill.php @@ -36,4 +36,12 @@ final class NullBill extends Bill $this->id = $id; parent::__construct(); } + + /** + * {@inheritdoc} + */ + public function jsonSerialize() : mixed + { + return ['id' => $this->id]; + } } diff --git a/Models/NullBillElement.php b/Models/NullBillElement.php index a7ad65e..77a5719 100755 --- a/Models/NullBillElement.php +++ b/Models/NullBillElement.php @@ -36,4 +36,12 @@ final class NullBillElement extends BillElement $this->id = $id; parent::__construct(); } + + /** + * {@inheritdoc} + */ + public function jsonSerialize() : mixed + { + return ['id' => $this->id]; + } } diff --git a/Models/NullBillType.php b/Models/NullBillType.php index 1cba56c..2e366b8 100755 --- a/Models/NullBillType.php +++ b/Models/NullBillType.php @@ -36,4 +36,12 @@ final class NullBillType extends BillType $this->id = $id; parent::__construct(); } + + /** + * {@inheritdoc} + */ + public function jsonSerialize() : mixed + { + return ['id' => $this->id]; + } }