diff --git a/CHANGELOG.md b/CHANGELOG.md index c2d8626..99c2222 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ - Enh #131: Throw `InvalidArgumentException` when missed "one" plural key (@vjik) - Bug #132: Fix incorrect locale usage when category source is not exist and specified fallback locale (@vjik) +- Bug #148: Fix the nullable parameter declarations for compatibility with PHP 8.4 (@martio) ## 3.0.0 February 17, 2023 diff --git a/src/Translator.php b/src/Translator.php index 880f98d..f496f08 100644 --- a/src/Translator.php +++ b/src/Translator.php @@ -72,8 +72,8 @@ public function getLocale(): string public function translate( string|Stringable $id, array $parameters = [], - string $category = null, - string $locale = null + ?string $category = null, + ?string $locale = null ): string { $locale ??= $this->locale; diff --git a/src/TranslatorInterface.php b/src/TranslatorInterface.php index 3a4242b..5adcdc3 100644 --- a/src/TranslatorInterface.php +++ b/src/TranslatorInterface.php @@ -46,8 +46,8 @@ public function getLocale(): string; public function translate( string|Stringable $id, array $parameters = [], - string $category = null, - string $locale = null + ?string $category = null, + ?string $locale = null ): string; /**