Fix "Cannot call method sub on possibly null value" bug pointed by Psalm

This commit is contained in:
Meritoo
2019-06-20 20:21:14 +02:00
parent 6efbf940a3
commit a1c3ba8543

View File

@@ -125,8 +125,11 @@ class Date
if (null !== $nextMonth) {
$dateEnd = $nextMonth->getStartDate();
if (null !== $dateEnd) {
$dateEnd->sub(new DateInterval('P1D'));
}
}
break;
case DatePeriod::NEXT_MONTH: