Skip to content

Commit b18d46c

Browse files
committed
Fix "null as an array offset" deprecation
1 parent 25a6566 commit b18d46c

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎src/Translator.php‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ protected function translatePlural(
167167
protected function getTranslation(?string $domain, ?string $context, string $original): ?array
168168
{
169169
if ($domain === null) {
170-
$domain = $this->domain;
170+
$domain = (string) $this->domain;
171171
}
172172

173173
if ($context === null) {
@@ -186,7 +186,7 @@ protected function getTranslation(?string $domain, ?string $context, string $ori
186186
protected function getPluralIndex(?string $domain, int $n, bool $fallback): int
187187
{
188188
if ($domain === null) {
189-
$domain = $this->domain;
189+
$domain = (string) $this->domain;
190190
}
191191

192192
//Not loaded domain or translation, use a fallback

0 commit comments

Comments
 (0)