@@ -20,12 +20,12 @@ discard block |
||
| 20 | 20 | /** @var int|null */ |
| 21 | 21 | private $lastObservance; |
| 22 | 22 | |
| 23 | - /** @var HolidayIteratorItemInterface */ |
|
| 24 | - private $wrapped; |
|
| 23 | + /** @var HolidayIteratorItemInterface */ |
|
| 24 | + private $wrapped; |
|
| 25 | 25 | |
| 26 | - public function __construct(HolidayIteratorItemInterface $wrapped, ?int $firstObservance, ?int $lastObservance) |
|
| 26 | + public function __construct(HolidayIteratorItemInterface $wrapped, ?int $firstObservance, ?int $lastObservance) |
|
| 27 | 27 | { |
| 28 | - $this->wrapped = $wrapped; |
|
| 28 | + $this->wrapped = $wrapped; |
|
| 29 | 29 | $this->firstObservance = $firstObservance; |
| 30 | 30 | $this->lastObservance = $lastObservance; |
| 31 | 31 | } |
@@ -39,22 +39,22 @@ discard block |
||
| 39 | 39 | return null === $this->lastObservance || $this->lastObservance >= $gregorianYear; |
| 40 | 40 | } |
| 41 | 41 | |
| 42 | - public function dateMatches(DateTimeInterface $date): bool |
|
| 43 | - { |
|
| 44 | - if (! $this->isWithinObservance((int) $date->format('Y'))) { |
|
| 45 | - return false; |
|
| 46 | - } |
|
| 42 | + public function dateMatches(DateTimeInterface $date): bool |
|
| 43 | + { |
|
| 44 | + if (! $this->isWithinObservance((int) $date->format('Y'))) { |
|
| 45 | + return false; |
|
| 46 | + } |
|
| 47 | 47 | |
| 48 | - return $this->wrapped->dateMatches($date); |
|
| 49 | - } |
|
| 48 | + return $this->wrapped->dateMatches($date); |
|
| 49 | + } |
|
| 50 | 50 | |
| 51 | - public function getName(): string |
|
| 52 | - { |
|
| 53 | - return $this->wrapped->getName(); |
|
| 54 | - } |
|
| 51 | + public function getName(): string |
|
| 52 | + { |
|
| 53 | + return $this->wrapped->getName(); |
|
| 54 | + } |
|
| 55 | 55 | |
| 56 | - public function isHoliday(): bool |
|
| 57 | - { |
|
| 58 | - return $this->wrapped->isHoliday(); |
|
| 59 | - } |
|
| 56 | + public function isHoliday(): bool |
|
| 57 | + { |
|
| 58 | + return $this->wrapped->isHoliday(); |
|
| 59 | + } |
|
| 60 | 60 | } |
@@ -78,7 +78,7 @@ |
||
| 78 | 78 | public function dateMatches(DateTimeInterface $date): bool |
| 79 | 79 | { |
| 80 | 80 | $year = (int) $date->format('Y'); |
| 81 | - $weekday = $this->calendarDay->getWeekdayForGregorianYear($year); |
|
| 81 | + $weekday = $this->calendarDay->getWeekdayForGregorianYear($year); |
|
| 82 | 82 | if (in_array($weekday, $this->forwardWhen, true)) { |
| 83 | 83 | return $this->calendarDay->isFollowUpDay($date, $this->forwardTo); |
| 84 | 84 | } |
@@ -59,7 +59,7 @@ |
||
| 59 | 59 | { |
| 60 | 60 | $year = (int) $date->format('Y'); |
| 61 | 61 | |
| 62 | - $easter = $this->getEaster($year); |
|
| 62 | + $easter = $this->getEaster($year); |
|
| 63 | 63 | if ($this->offset < 0) { |
| 64 | 64 | $day = $easter->sub(new DateInterval('P' . $this->offset * -1 . 'D')); |
| 65 | 65 | } else { |
@@ -78,20 +78,20 @@ discard block |
||
| 78 | 78 | continue; |
| 79 | 79 | } |
| 80 | 80 | |
| 81 | - try { |
|
| 82 | - $element = $this->getElement($child); |
|
| 83 | - if ($child->hasAttribute('firstobservance') || $child->hasAttribute('lastobservance')) { |
|
| 84 | - $element = new ObservanceDecorator( |
|
| 85 | - $element, |
|
| 86 | - $child->hasAttribute('firstobservance') ? (int) $child->getAttribute('firstobservance') : null, |
|
| 87 | - $child->hasAttribute('lastobservance') ? (int) $child->getAttribute('lastobservance') : null, |
|
| 88 | - ); |
|
| 89 | - } |
|
| 90 | - |
|
| 91 | - $iterator->append($element); |
|
| 92 | - } catch (Throwable $e) { |
|
| 93 | - // Do nothing on purpose |
|
| 94 | - } |
|
| 81 | + try { |
|
| 82 | + $element = $this->getElement($child); |
|
| 83 | + if ($child->hasAttribute('firstobservance') || $child->hasAttribute('lastobservance')) { |
|
| 84 | + $element = new ObservanceDecorator( |
|
| 85 | + $element, |
|
| 86 | + $child->hasAttribute('firstobservance') ? (int) $child->getAttribute('firstobservance') : null, |
|
| 87 | + $child->hasAttribute('lastobservance') ? (int) $child->getAttribute('lastobservance') : null, |
|
| 88 | + ); |
|
| 89 | + } |
|
| 90 | + |
|
| 91 | + $iterator->append($element); |
|
| 92 | + } catch (Throwable $e) { |
|
| 93 | + // Do nothing on purpose |
|
| 94 | + } |
|
| 95 | 95 | } |
| 96 | 96 | |
| 97 | 97 | return $iterator; |
@@ -177,7 +177,7 @@ discard block |
||
| 177 | 177 | default: |
| 178 | 178 | throw new RuntimeException('Unknown element encountered'); |
| 179 | 179 | } |
| 180 | - } |
|
| 180 | + } |
|
| 181 | 181 | |
| 182 | 182 | private function getFree(DOMElement $element): bool |
| 183 | 183 | { |