Skip to content

Commit

Permalink
Remove obsolete return type
Browse files Browse the repository at this point in the history
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
  • Loading branch information
heiglandreas committed Dec 15, 2022
1 parent 8443078 commit 883fe04
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/IteratorItem/Easter.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'));
}
Expand All @@ -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)
{
Expand Down

0 comments on commit 883fe04

Please sign in to comment.