diff --git a/src/HasTranslations.php b/src/HasTranslations.php index dda08f0..39064e9 100644 --- a/src/HasTranslations.php +++ b/src/HasTranslations.php @@ -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); @@ -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(); @@ -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;