mirror of
https://github.com/wiosna-dev/common-library.git
synced 2026-03-13 10:01:51 +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) {
|
if (null !== $nextMonth) {
|
||||||
$dateEnd = $nextMonth->getStartDate();
|
$dateEnd = $nextMonth->getStartDate();
|
||||||
|
|
||||||
|
if (null !== $dateEnd) {
|
||||||
$dateEnd->sub(new DateInterval('P1D'));
|
$dateEnd->sub(new DateInterval('P1D'));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case DatePeriod::NEXT_MONTH:
|
case DatePeriod::NEXT_MONTH:
|
||||||
|
|||||||
Reference in New Issue
Block a user