From b18d46c83e3905f53d0c90d3ce8db3cb0db932fa Mon Sep 17 00:00:00 2001 From: Michele Locati Date: Thu, 18 Jun 2026 12:21:29 +0200 Subject: [PATCH] Fix "null as an array offset" deprecation --- src/Translator.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Translator.php b/src/Translator.php index 2bf1d15..4e169e6 100644 --- a/src/Translator.php +++ b/src/Translator.php @@ -167,7 +167,7 @@ protected function translatePlural( protected function getTranslation(?string $domain, ?string $context, string $original): ?array { if ($domain === null) { - $domain = $this->domain; + $domain = (string) $this->domain; } if ($context === null) { @@ -186,7 +186,7 @@ protected function getTranslation(?string $domain, ?string $context, string $ori protected function getPluralIndex(?string $domain, int $n, bool $fallback): int { if ($domain === null) { - $domain = $this->domain; + $domain = (string) $this->domain; } //Not loaded domain or translation, use a fallback