Skip to content

Commit

Permalink
Fix type-error in getMessage() if $item is null
Browse files Browse the repository at this point in the history
  • Loading branch information
duxthefux committed Apr 24, 2020
1 parent eb95282 commit 08442c4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Translator.php
Original file line number Diff line number Diff line change
Expand Up @@ -260,10 +260,14 @@ public function getMessage(string $key, ?string $locale = null)

$locales = [$locale ?: $this->locale];

$message = null;

foreach ($locales as $locale) {
$this->load($namespace, $group, $locale);

$message = $this->getLine($namespace, $group, $locale, $item);
if ($item !== null) {
$message = $this->getLine($namespace, $group, $locale, $item);
}

if ($message !== null) {
break;
Expand Down

0 comments on commit 08442c4

Please sign in to comment.