Skip to content

Commit 9e202ca

Browse files
authored
Fix the nullable parameter declarations for compatibility with PHP 8.4 (#148)
1 parent 50dcaa5 commit 9e202ca

3 files changed

Lines changed: 5 additions & 4 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
- Enh #131: Throw `InvalidArgumentException` when missed "one" plural key (@vjik)
66
- Bug #132: Fix incorrect locale usage when category source is not exist and specified fallback locale (@vjik)
7+
- Bug #148: Fix the nullable parameter declarations for compatibility with PHP 8.4 (@martio)
78

89
## 3.0.0 February 17, 2023
910

src/Translator.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ public function getLocale(): string
7272
public function translate(
7373
string|Stringable $id,
7474
array $parameters = [],
75-
string $category = null,
76-
string $locale = null
75+
?string $category = null,
76+
?string $locale = null
7777
): string {
7878
$locale ??= $this->locale;
7979

src/TranslatorInterface.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ public function getLocale(): string;
4646
public function translate(
4747
string|Stringable $id,
4848
array $parameters = [],
49-
string $category = null,
50-
string $locale = null
49+
?string $category = null,
50+
?string $locale = null
5151
): string;
5252

5353
/**

0 commit comments

Comments
 (0)