Skip to content

Commit

Permalink
Update HasTranslations.php
Browse files Browse the repository at this point in the history
  • Loading branch information
jochensengier authored Nov 27, 2024
1 parent 03ada4b commit eb0f48e
Showing 1 changed file with 3 additions and 3 deletions.
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

0 comments on commit eb0f48e

Please sign in to comment.