From 1e3fc4a9a46c56d6b4f613d71673ea472b6a0bd3 Mon Sep 17 00:00:00 2001 From: Florent Morselli Date: Thu, 18 Jan 2024 21:59:51 +0100 Subject: [PATCH] Fix return definition for null values --- src/Dto/Manifest.php | 8 ++++---- src/Dto/Screenshot.php | 2 +- src/Dto/ShareTargetParameters.php | 4 ++-- src/Dto/Shortcut.php | 4 ++-- src/Dto/Widget.php | 4 ++-- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/Dto/Manifest.php b/src/Dto/Manifest.php index a49b688..9080178 100644 --- a/src/Dto/Manifest.php +++ b/src/Dto/Manifest.php @@ -120,24 +120,24 @@ public function getCategories(): array return $this->provideTranslation($this->categories); } - public function getDescription(): string|TranslatableInterface + public function getDescription(): null|string|TranslatableInterface { return $this->provideTranslation($this->description); } - public function getName(): string|TranslatableInterface + public function getName(): null|string|TranslatableInterface { return $this->provideTranslation($this->name); } #[SerializedName('short_name')] - public function getShortName(): string|TranslatableInterface + public function getShortName(): null|string|TranslatableInterface { return $this->provideTranslation($this->shortName); } #[SerializedName('start_url')] - public function getStartUrl(): string|TranslatableInterface + public function getStartUrl(): null|string|TranslatableInterface { return $this->provideTranslation($this->startUrl); } diff --git a/src/Dto/Screenshot.php b/src/Dto/Screenshot.php index b8b7a58..bc71554 100644 --- a/src/Dto/Screenshot.php +++ b/src/Dto/Screenshot.php @@ -26,7 +26,7 @@ final class Screenshot public null|string $format = null; - public function getLabel(): string|TranslatableInterface + public function getLabel(): null|string|TranslatableInterface { return $this->provideTranslation($this->label); } diff --git a/src/Dto/ShareTargetParameters.php b/src/Dto/ShareTargetParameters.php index f43d21e..e82fb8c 100644 --- a/src/Dto/ShareTargetParameters.php +++ b/src/Dto/ShareTargetParameters.php @@ -21,12 +21,12 @@ final class ShareTargetParameters */ public array $files = []; - public function getTitle(): string|TranslatableInterface + public function getTitle(): null|string|TranslatableInterface { return $this->provideTranslation($this->title); } - public function getText(): string|TranslatableInterface + public function getText(): null|string|TranslatableInterface { return $this->provideTranslation($this->text); } diff --git a/src/Dto/Shortcut.php b/src/Dto/Shortcut.php index 4aebba8..60cf583 100644 --- a/src/Dto/Shortcut.php +++ b/src/Dto/Shortcut.php @@ -31,12 +31,12 @@ public function getName(): string|TranslatableInterface } #[SerializedName('short_name')] - public function getShortName(): string|TranslatableInterface + public function getShortName(): null|string|TranslatableInterface { return $this->provideTranslation($this->shortName); } - public function getDescription(): string|TranslatableInterface + public function getDescription(): null|string|TranslatableInterface { return $this->provideTranslation($this->description); } diff --git a/src/Dto/Widget.php b/src/Dto/Widget.php index acc5074..6af26e1 100644 --- a/src/Dto/Widget.php +++ b/src/Dto/Widget.php @@ -51,12 +51,12 @@ public function getName(): string|TranslatableInterface } #[SerializedName('short_name')] - public function getShortName(): string|TranslatableInterface + public function getShortName(): null|string|TranslatableInterface { return $this->provideTranslation($this->shortName); } - public function getDescription(): string|TranslatableInterface + public function getDescription(): null|string|TranslatableInterface { return $this->provideTranslation($this->description); }