From 6316df61061ae1a136445f8e072d878dc2d2b6fa Mon Sep 17 00:00:00 2001 From: Buster Neece Date: Tue, 19 Mar 2024 05:41:43 -0500 Subject: [PATCH] Fix CarbonImmutable checks. --- src/Radio/AutoDJ/Scheduler.php | 4 ++-- src/Radio/Backend/Liquidsoap/ConfigWriter.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Radio/AutoDJ/Scheduler.php b/src/Radio/AutoDJ/Scheduler.php index 11d993f71..25f5b1744 100644 --- a/src/Radio/AutoDJ/Scheduler.php +++ b/src/Radio/AutoDJ/Scheduler.php @@ -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; diff --git a/src/Radio/Backend/Liquidsoap/ConfigWriter.php b/src/Radio/Backend/Liquidsoap/ConfigWriter.php index 2ed00eedb..ce3f9d210 100644 --- a/src/Radio/Backend/Liquidsoap/ConfigWriter.php +++ b/src/Radio/Backend/Liquidsoap/ConfigWriter.php @@ -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();