Remove superfluous checks

This commit is contained in:
Joshua Ramon Enslin 2022-09-08 16:41:34 +02:00
parent c8d0292ca8
commit df1d2c10eb
Signed by: jrenslin
GPG Key ID: 46016F84501B70AE

View File

@ -451,14 +451,14 @@ final class NodaTimeSplitter {
if (self::is_numeric((string)\substr($datum, 0, 2))) {
$day = \substr($datum, 0, 2);
}
else if (\in_array(\substr($datum, 1, 1), [".", " "]) && self::is_numeric((string)\substr($datum, 0, 1))) {
else if (\in_array(\substr($datum, 1, 1), [".", " "], true) && self::is_numeric((string)\substr($datum, 0, 1))) {
$day = "0" . \substr($datum, 0, 1);
}
if (!empty($year) and !empty($monat) and !empty($day) and $use_day) {
if (!empty($monat) and !empty($day) and $use_day) {
return [$year, $year, $monat, $day, '+', ""];
}
else if (!empty($year) and !empty($monat)) {
else if (!empty($monat)) {
return [$year, $year, $monat, "00", '+', ""];
}
return [];
@ -537,10 +537,10 @@ final class NodaTimeSplitter {
}
}
if (!empty($year) and !empty($monat) and !empty($day)) {
if (!empty($monat) and !empty($day)) {
return [$year, $year, $monat, $day, '+', ""];
}
else if (!empty($year) and !empty($monat)) {
else if (!empty($monat)) {
return [$year, $year, $monat, "00", '+', ""];
}
return [];