Phan/phpstan fixes

This commit is contained in:
Clemens Schwaighofer
2022-07-29 11:06:53 +09:00
parent 6d0e528c38
commit bcdb877d90
3 changed files with 6 additions and 8 deletions

View File

@@ -209,7 +209,7 @@ class DateTime
if ($isodow < 1 || $isodow > 7) {
return $long ? 'Invalid' : 'Inv';
}
return date($long ? 'l' : 'D', strtotime("Sunday +{$isodow} days"));
return date($long ? 'l' : 'D', strtotime("Sunday +{$isodow} days") ?: null);
}
/**
@@ -224,7 +224,7 @@ class DateTime
if (!self::checkDate($date)) {
return $long ? 'Invalid' : 'Inv';
}
return date($long ? 'l' : 'D', strtotime($date));
return date($long ? 'l' : 'D', strtotime($date) ?: null);
}
/**
@@ -238,7 +238,7 @@ class DateTime
if (!self::checkDate($date)) {
return -1;
}
return (int)date('N', strtotime($date));
return (int)date('N', strtotime($date) ?: null);
}
/**