From 883fe04d4bb99d9c349865dc7524f6f4811f5023 Mon Sep 17 00:00:00 2001 From: Andreas Heigl Date: Thu, 15 Dec 2022 07:18:36 +0100 Subject: [PATCH] Remove obsolete return type The `add` and `sub` methods of `DateTime[Immutable]` always return an object and never `false` so we do not need to declare `false` as return type --- src/IteratorItem/Easter.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/IteratorItem/Easter.php b/src/IteratorItem/Easter.php index c429e03..7bee436 100644 --- a/src/IteratorItem/Easter.php +++ b/src/IteratorItem/Easter.php @@ -63,10 +63,6 @@ public function dateMatches(DateTimeInterface $date): bool $easter = $this->getEaster($year); $day = $this->getOffsetDay($easter, $this->offset); - if (false === $day) { - return false; - } - $comparator = new DateIntervalComparator(); return 0 > $comparator->compare($day->diff($date), new DateInterval('P1D')); } @@ -91,7 +87,7 @@ protected function getEaster(int $year): DateTimeImmutable /** * @param DateTime|DateTimeImmutable $date - * @return DateTime|DateTimeImmutable|false + * @return DateTime|DateTimeImmutable */ private function getOffsetDay($date, int $offset) {