Add check for improved type safety

This commit is contained in:
Joshua Ramon Enslin 2020-09-26 15:19:04 +02:00 committed by Stefan Rohde-Enslin
parent 3058f25a1c
commit 2b8b5d5743

View File

@ -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) {