From 094fa78a2a90d9b04f6f8ea2c0c1fac0e56eefe2 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/NullCollection.php | 8 ++++++++ Models/NullMedia.php | 8 ++++++++ Models/NullMediaContent.php | 8 ++++++++ Models/NullMediaType.php | 8 ++++++++ Models/NullMediaTypeL11n.php | 8 ++++++++ Models/NullReference.php | 8 ++++++++ 6 files changed, 48 insertions(+) diff --git a/Models/NullCollection.php b/Models/NullCollection.php index 2755659..d21b782 100755 --- a/Models/NullCollection.php +++ b/Models/NullCollection.php @@ -36,4 +36,12 @@ final class NullCollection extends Collection $this->id = $id; parent::__construct(); } + + /** + * {@inheritdoc} + */ + public function jsonSerialize() : mixed + { + return ['id' => $this->id]; + } } diff --git a/Models/NullMedia.php b/Models/NullMedia.php index 6adf5ef..b7a2db8 100755 --- a/Models/NullMedia.php +++ b/Models/NullMedia.php @@ -36,4 +36,12 @@ final class NullMedia extends Media $this->id = $id; parent::__construct(); } + + /** + * {@inheritdoc} + */ + public function jsonSerialize() : mixed + { + return ['id' => $this->id]; + } } diff --git a/Models/NullMediaContent.php b/Models/NullMediaContent.php index d42b929..a9547d7 100755 --- a/Models/NullMediaContent.php +++ b/Models/NullMediaContent.php @@ -35,4 +35,12 @@ final class NullMediaContent extends MediaContent { $this->id = $id; } + + /** + * {@inheritdoc} + */ + public function jsonSerialize() : mixed + { + return ['id' => $this->id]; + } } diff --git a/Models/NullMediaType.php b/Models/NullMediaType.php index 6ff4b50..831da83 100755 --- a/Models/NullMediaType.php +++ b/Models/NullMediaType.php @@ -35,4 +35,12 @@ final class NullMediaType extends MediaType { $this->id = $id; } + + /** + * {@inheritdoc} + */ + public function jsonSerialize() : mixed + { + return ['id' => $this->id]; + } } diff --git a/Models/NullMediaTypeL11n.php b/Models/NullMediaTypeL11n.php index 797c9e0..a62353a 100755 --- a/Models/NullMediaTypeL11n.php +++ b/Models/NullMediaTypeL11n.php @@ -36,4 +36,12 @@ final class NullMediaTypeL11n extends MediaTypeL11n $this->id = $id; parent::__construct(); } + + /** + * {@inheritdoc} + */ + public function jsonSerialize() : mixed + { + return ['id' => $this->id]; + } } diff --git a/Models/NullReference.php b/Models/NullReference.php index 5da90aa..e5d1f1c 100755 --- a/Models/NullReference.php +++ b/Models/NullReference.php @@ -36,4 +36,12 @@ final class NullReference extends Reference $this->id = $id; parent::__construct(); } + + /** + * {@inheritdoc} + */ + public function jsonSerialize() : mixed + { + return ['id' => $this->id]; + } }