mirror of
https://github.com/wiosna-dev/common-library.git
synced 2026-03-12 17:41:50 +01:00
Fix "Cannot call method sub on possibly null value" bug pointed by Psalm
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user