From 2b8b5d5743809d243d9de6f3eb14f9e30668954c Mon Sep 17 00:00:00 2001 From: Joshua Ramon Enslin Date: Sat, 26 Sep 2020 15:19:04 +0200 Subject: [PATCH] Add check for improved type safety --- src/NodaTimeAutotranslater.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/NodaTimeAutotranslater.php b/src/NodaTimeAutotranslater.php index b8b69d8..ee1ff69 100644 --- a/src/NodaTimeAutotranslater.php +++ b/src/NodaTimeAutotranslater.php @@ -430,7 +430,7 @@ final class NodaTimeAutotranslater { $output = []; foreach (self::LANGS_TO_CE_FORMAT as $tLang => $ceFormat) { - if ($suffixMode === 2) { + if (!empty($timeInfoToCopy) and $suffixMode === 2) { $ceIndicatorsToRemove = explode("%s", self::LANGS_TO_CE_FORMAT[$tLang]); $year = self::getTranslations($timeInfoToCopy)[$tLang]; foreach ($ceIndicatorsToRemove as $ceIndicatorToRemove) {