Skip to content

Commit

Permalink
Fix the nullable parameter declarations for compatibility with PHP 8.4 (
Browse files Browse the repository at this point in the history
  • Loading branch information
martio authored Dec 25, 2024
1 parent 50dcaa5 commit 9e202ca
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions src/Translator.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
4 changes: 2 additions & 2 deletions src/TranslatorInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

/**
Expand Down

0 comments on commit 9e202ca

Please sign in to comment.