Fix CarbonImmutable checks.

This commit is contained in:
Buster Neece 2024-03-19 05:41:43 -05:00
parent 4324f94cb2
commit 6316df6106
No known key found for this signature in database
2 changed files with 4 additions and 4 deletions

View File

@ -406,7 +406,7 @@ final class Scheduler
if (!empty($startDate)) {
$startDate = CarbonImmutable::createFromFormat('Y-m-d', $startDate, $now->getTimezone());
if (false !== $startDate) {
if (null !== $startDate) {
$startDate = $startDate->setTime(0, 0);
if ($now->lt($startDate)) {
return false;
@ -417,7 +417,7 @@ final class Scheduler
if (!empty($endDate)) {
$endDate = CarbonImmutable::createFromFormat('Y-m-d', $endDate, $now->getTimezone());
if (false !== $endDate) {
if (null !== $endDate) {
$endDate = $endDate->setTime(23, 59, 59);
if ($now->gt($endDate)) {
return false;

View File

@ -848,7 +848,7 @@ final class ConfigWriter implements EventSubscriberInterface
if (!empty($startDate)) {
$startDateObj = CarbonImmutable::createFromFormat('Y-m-d', $startDate, $tzObject);
if (false !== $startDateObj) {
if (null !== $startDateObj) {
$startDateObj = $startDateObj->setTime(0, 0);
$customFunctionBody[] = ' # ' . $startDateObj->__toString();
@ -860,7 +860,7 @@ final class ConfigWriter implements EventSubscriberInterface
if (!empty($endDate)) {
$endDateObj = CarbonImmutable::createFromFormat('Y-m-d', $endDate, $tzObject);
if (false !== $endDateObj) {
if (null !== $endDateObj) {
$endDateObj = $endDateObj->setTime(23, 59, 59);
$customFunctionBody[] = ' # ' . $endDateObj->__toString();