From 556750924b4dbf232c33a9e8650e476103b169eb Mon Sep 17 00:00:00 2001 From: Steve Boyd Date: Mon, 6 Nov 2023 15:00:31 +1300 Subject: [PATCH] FIX Handle non-array --- src/Translator.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Translator.php b/src/Translator.php index dfcd64c..372fe49 100644 --- a/src/Translator.php +++ b/src/Translator.php @@ -331,7 +331,7 @@ private function removeEnglishStringsFromYamlTranslations(): void // Remove any keys where the value is the same as the source english value $contentYaml = Yaml::parse(file_get_contents($path)); foreach (array_keys($contentYaml) as $countryCode) { - foreach (array_keys($contentYaml[$countryCode]) as $className) { + foreach (array_keys($contentYaml[$countryCode] ?? []) as $className) { foreach (array_keys($contentYaml[$countryCode][$className]) as $key) { $value = $contentYaml[$countryCode][$className][$key] ?? null; $enValue = $enYaml['en'][$className][$key] ?? null;