Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP 8.4 deprecates implicitly nullable parameter types. #458

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/HasTranslations.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ public function getTranslationWithoutFallback(string $key, string $locale): mixe
return $this->getTranslation($key, $locale, false);
}

public function getTranslations(string $key = null, array $allowedLocales = null): array
public function getTranslations(?string $key = null, ?array $allowedLocales = null): array
{
if ($key !== null) {
$this->guardAgainstNonTranslatableAttribute($key);
Expand Down Expand Up @@ -223,7 +223,7 @@ public function isTranslatableAttribute(string $key): bool
return in_array($key, $this->getTranslatableAttributes());
}

public function hasTranslation(string $key, string $locale = null): bool
public function hasTranslation(string $key, ?string $locale = null): bool
{
$locale = $locale ?: $this->getLocale();

Expand Down Expand Up @@ -279,7 +279,7 @@ protected function normalizeLocale(string $key, string $locale, bool $useFallbac
return $locale;
}

protected function filterTranslations(mixed $value = null, string $locale = null, array $allowedLocales = null): bool
protected function filterTranslations(mixed $value = null, ?string $locale = null, ?array $allowedLocales = null): bool
{
if ($value === null) {
return false;
Expand Down
2 changes: 1 addition & 1 deletion src/Translatable.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class Translatable
public function fallback(
?string $fallbackLocale = null,
?bool $fallbackAny = false,
$missingKeyCallback = null
?Closure $missingKeyCallback = null
): self {
$this->fallbackLocale = $fallbackLocale;
$this->fallbackAny = $fallbackAny;
Expand Down
Loading