Improve type-safety

This commit is contained in:
Joshua Ramon Enslin 2020-09-26 15:21:32 +02:00 committed by Stefan Rohde-Enslin
parent 2b8b5d5743
commit 8eda7d4c7f

View File

@ -430,7 +430,11 @@ final class NodaTimeAutotranslater {
$output = [];
foreach (self::LANGS_TO_CE_FORMAT as $tLang => $ceFormat) {
if (!empty($timeInfoToCopy) and $suffixMode === 2) {
if ($suffixMode === 2) {
if (empty($timeInfoToCopy)) {
throw new Exception("No time information to copy existent");
}
$ceIndicatorsToRemove = explode("%s", self::LANGS_TO_CE_FORMAT[$tLang]);
$year = self::getTranslations($timeInfoToCopy)[$tLang];
foreach ($ceIndicatorsToRemove as $ceIndicatorToRemove) {