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

This commit is contained in:
Meritoo
2019-06-20 21:04:44 +02:00
parent c0998ac5b9
commit 4ddc299e5b

View File

@@ -120,8 +120,11 @@ class Date
if (null !== $lastMonth) {
$dateStart = $lastMonth->getEndDate();
if (null !== $dateStart) {
$dateStart->add(new DateInterval('P1D'));
}
}
if (null !== $nextMonth) {
$dateEnd = $nextMonth->getStartDate();