Completed
Push — allowFirstAndLastObservance ( 2d2850 )
by Andreas
20s
created
src/IteratorItem/EasterOrthodox.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -69,7 +69,7 @@
 block discarded – undo
69 69
         $orthodoxEaster = $this->getOrthodoxEaster($year);
70 70
         if ($endOfPessach > $orthodoxEaster) {
71 71
             $weekday = (int) $endOfPessach->format('w');
72
-            return $endOfPessach->add(new DateInterval('P' . (7-$weekday) . 'D'));
72
+            return $endOfPessach->add(new DateInterval('P' . (7 - $weekday) . 'D'));
73 73
         }
74 74
 
75 75
         return $orthodoxEaster;
Please login to merge, or discard this patch.
src/CalendarDayFactory.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@
 block discarded – undo
40 40
 {
41 41
     public static function createCalendarDay(int $day, int $month, string $calendar): CalendarDay
42 42
     {
43
-        if (! Calendar::isValidCalendarName($calendar)) {
43
+        if (!Calendar::isValidCalendarName($calendar)) {
44 44
             throw new UnknownCalendar(sprintf(
45 45
                 'The calendar %s is not known to the ICU',
46 46
                 $calendar
Please login to merge, or discard this patch.
src/HolidayIterator.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@
 block discarded – undo
46 46
     #[\ReturnTypeWillChange]
47 47
     public function append($value)
48 48
     {
49
-        if (! $value instanceof HolidayIteratorItemInterface) {
49
+        if (!$value instanceof HolidayIteratorItemInterface) {
50 50
             return;
51 51
         }
52 52
 
Please login to merge, or discard this patch.
src/CalendarDay.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
         $day = $cal->toDateTime();
124 124
         $day->modify('next ' . $followUpDay);
125 125
         $cal->setTime($day->getTimestamp() * 1000);
126
-        $cal2         = clone $this->calendar;
126
+        $cal2 = clone $this->calendar;
127 127
         $cal2->setTime($dateTime->getTimestamp() * 1000);
128 128
 
129 129
         if (null !== $this->year && $cal->get(IntlCalendar::FIELD_YEAR) !== $cal2->get(IntlCalendar::FIELD_YEAR)) {
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
         $day = $cal->toDateTime();
145 145
         $day->modify('previous ' . $previousDay);
146 146
         $cal->setTime($day->getTimestamp() * 1000);
147
-        $cal2         = clone $this->calendar;
147
+        $cal2 = clone $this->calendar;
148 148
         $cal2->setTime($dateTime->getTimestamp() * 1000);
149 149
 
150 150
         if (null !== $this->year && $cal->get(IntlCalendar::FIELD_YEAR) !== $cal2->get(IntlCalendar::FIELD_YEAR)) {
Please login to merge, or discard this patch.
src/HolidayIteratorFactory.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -66,11 +66,11 @@  discard block
 block discarded – undo
66 66
         $dom->load($file);
67 67
         $dom->xinclude();
68 68
 
69
-        if (! @$dom->schemaValidate(__DIR__ . '/../share/holidays.xsd')) {
69
+        if (!@$dom->schemaValidate(__DIR__ . '/../share/holidays.xsd')) {
70 70
             throw new Exception('XML-File does not validate agains schema');
71 71
         }
72 72
         foreach ($dom->documentElement->childNodes as $child) {
73
-            if (! $child instanceof DOMElement) {
73
+            if (!$child instanceof DOMElement) {
74 74
                 continue;
75 75
             }
76 76
             if ($child->nodeName === 'resources') {
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
         $file = __DIR__ . '/../share/%s.xml';
95 95
         $file1 = sprintf($file, $isoCode);
96 96
 
97
-        if (! is_readable($file1)) {
97
+        if (!is_readable($file1)) {
98 98
             throw new UnexpectedValueException(sprintf(
99 99
                 'There is no holiday-file for %s',
100 100
                 $isoCode
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
                 $day = CalendarDayFactory::createCalendarDay(
126 126
                     (int) $child->getAttribute('day'),
127 127
                     (int) $child->getAttribute('month'),
128
-                    ($child->hasAttribute('calendar')?$child->getAttribute('calendar'): 'gregorian')
128
+                    ($child->hasAttribute('calendar') ? $child->getAttribute('calendar') : 'gregorian')
129 129
                 );
130 130
                 if ($child->hasAttribute('year')) {
131 131
                     $day->setYear((int) $child->getAttribute('year'));
@@ -134,17 +134,17 @@  discard block
 block discarded – undo
134 134
                     $child->textContent,
135 135
                     $this->getFree($child),
136 136
                     $day,
137
-                    $child->hasAttribute('forwardto')?$child->getAttribute('forwardto'):'',
138
-                    $child->hasAttribute('forwardwhen')?explode(' ', $child->getAttribute('forwardwhen')):[],
139
-                    $child->hasAttribute('rewindto')?$child->getAttribute('rewindto'):'',
140
-                    $child->hasAttribute('rewindwhen')?explode(' ', $child->getAttribute('rewindwhen')):[],
137
+                    $child->hasAttribute('forwardto') ? $child->getAttribute('forwardto') : '',
138
+                    $child->hasAttribute('forwardwhen') ?explode(' ', $child->getAttribute('forwardwhen')) : [],
139
+                    $child->hasAttribute('rewindto') ? $child->getAttribute('rewindto') : '',
140
+                    $child->hasAttribute('rewindwhen') ?explode(' ', $child->getAttribute('rewindwhen')) : [],
141 141
                 );
142 142
                 break;
143 143
             case 'dateFollowUp':
144 144
                 $day = CalendarDayFactory::createCalendarDay(
145 145
                     (int) $child->getAttribute('day'),
146 146
                     (int) $child->getAttribute('month'),
147
-                    ($child->hasAttribute('calendar')?$child->getAttribute('calendar'): 'gregorian')
147
+                    ($child->hasAttribute('calendar') ? $child->getAttribute('calendar') : 'gregorian')
148 148
                 );
149 149
 
150 150
                 $return = new DateFollowUp(
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
                     $this->getFree($child),
153 153
                     $day,
154 154
                     $child->getAttribute('followup'),
155
-                    ($child->hasAttribute('replaced')?explode(' ', $child->getAttribute('replaced')):[])
155
+                    ($child->hasAttribute('replaced') ?explode(' ', $child->getAttribute('replaced')) : [])
156 156
                 );
157 157
                 break;
158 158
             case 'relative':
@@ -169,8 +169,8 @@  discard block
 block discarded – undo
169 169
         }
170 170
         if ($return instanceof ObservanceInterface) {
171 171
             $return->setObservances(
172
-                $child->hasAttribute('firstobservance')?(int) $child->getAttribute('firstobservance'):null,
173
-                $child->hasAttribute('lastobservance')?(int) $child->getAttribute('lastobservance'):null,
172
+                $child->hasAttribute('firstobservance') ? (int) $child->getAttribute('firstobservance') : null,
173
+                $child->hasAttribute('lastobservance') ? (int) $child->getAttribute('lastobservance') : null,
174 174
             );
175 175
         }
176 176
         return $return;
Please login to merge, or discard this patch.
src/IteratorItem/Relative.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -65,7 +65,7 @@
 block discarded – undo
65 65
     public function dateMatches(DateTimeInterface $date): bool
66 66
     {
67 67
         $year = (int) $date->format('Y');
68
-        if (! $this->isWithinObservance($year)) {
68
+        if (!$this->isWithinObservance($year)) {
69 69
             return false;
70 70
         }
71 71
 
Please login to merge, or discard this patch.
src/IteratorItem/DateFollowUp.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
     public function dateMatches(DateTimeInterface $date): bool
73 73
     {
74 74
         $gregorianYear = (int) $date->format('Y');
75
-        if (! $this->isWithinObservance($gregorianYear)) {
75
+        if (!$this->isWithinObservance($gregorianYear)) {
76 76
             return false;
77 77
         }
78 78
 
@@ -114,8 +114,8 @@  discard block
 block discarded – undo
114 114
             ];
115 115
         }
116 116
 
117
-        return array_map(function (string $day) use ($daymap) {
118
-            if (! isset($daymap[$day])) {
117
+        return array_map(function(string $day) use ($daymap) {
118
+            if (!isset($daymap[$day])) {
119 119
                 return null;
120 120
             }
121 121
             return $daymap[$day];
Please login to merge, or discard this patch.
src/IteratorItem/Easter.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -62,7 +62,7 @@
 block discarded – undo
62 62
     public function dateMatches(DateTimeInterface $date): bool
63 63
     {
64 64
         $year = (int) $date->format('Y');
65
-        if (! $this->isWithinObservance($year)) {
65
+        if (!$this->isWithinObservance($year)) {
66 66
             return false;
67 67
         }
68 68
 
Please login to merge, or discard this patch.
src/IteratorItem/Date.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
     public function dateMatches(DateTimeInterface $date): bool
83 83
     {
84 84
         $year = (int) $date->format('Y');
85
-        if (! $this->isWithinObservance($year)) {
85
+        if (!$this->isWithinObservance($year)) {
86 86
             return false;
87 87
         }
88 88
         $weekday = $this->calendarDay->getWeekdayForGregorianYear($year);
@@ -122,8 +122,8 @@  discard block
 block discarded – undo
122 122
             'saturday' => IntlCalendar::DOW_SATURDAY,
123 123
         ];
124 124
 
125
-        return array_map(function (string $day) use ($daymap) {
126
-            if (! isset($daymap[$day])) {
125
+        return array_map(function(string $day) use ($daymap) {
126
+            if (!isset($daymap[$day])) {
127 127
                 return null;
128 128
             }
129 129
             return $daymap[$day];
Please login to merge, or discard this patch.