Completed
Push — allowFirstAndLastObservance ( 2d2850 )
by Andreas
20s
created
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.