Completed
Push — allowFirstAndLastObservance ( 2eaec1...6e109b )
by Andreas
13s
created
src/IteratorItem/DateFollowUp.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -102,8 +102,8 @@
 block discarded – undo
102 102
             ];
103 103
         }
104 104
 
105
-        return array_map(function (string $day) use ($daymap) {
106
-            if (! isset($daymap[$day])) {
105
+        return array_map(function(string $day) use ($daymap) {
106
+            if (!isset($daymap[$day])) {
107 107
                 return null;
108 108
             }
109 109
             return $daymap[$day];
Please login to merge, or discard this patch.
src/IteratorItem/Date.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -113,8 +113,8 @@
 block discarded – undo
113 113
             'saturday' => IntlCalendar::DOW_SATURDAY,
114 114
         ];
115 115
 
116
-        return array_map(function (string $day) use ($daymap) {
117
-            if (! isset($daymap[$day])) {
116
+        return array_map(function(string $day) use ($daymap) {
117
+            if (!isset($daymap[$day])) {
118 118
                 return null;
119 119
             }
120 120
             return $daymap[$day];
Please login to merge, or discard this patch.
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -78,7 +78,7 @@
 block discarded – undo
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
         }
Please login to merge, or discard this patch.
src/HolidayIteratorFactory.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -169,7 +169,7 @@
 block discarded – undo
169 169
         }
170 170
         if ($child->hasAttribute('firstobservance') || $child->hasAttribute('lastobservance')) {
171 171
             $return = new ObservanceDecorator(
172
-				$return,
172
+                $return,
173 173
                 $child->hasAttribute('firstobservance')?(int) $child->getAttribute('firstobservance'):null,
174 174
                 $child->hasAttribute('lastobservance')?(int) $child->getAttribute('lastobservance'):null,
175 175
             );
Please login to merge, or discard this 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':
@@ -170,8 +170,8 @@  discard block
 block discarded – undo
170 170
         if ($child->hasAttribute('firstobservance') || $child->hasAttribute('lastobservance')) {
171 171
             $return = new ObservanceDecorator(
172 172
 				$return,
173
-                $child->hasAttribute('firstobservance')?(int) $child->getAttribute('firstobservance'):null,
174
-                $child->hasAttribute('lastobservance')?(int) $child->getAttribute('lastobservance'):null,
173
+                $child->hasAttribute('firstobservance') ? (int) $child->getAttribute('firstobservance') : null,
174
+                $child->hasAttribute('lastobservance') ? (int) $child->getAttribute('lastobservance') : null,
175 175
             );
176 176
         }
177 177
 
Please login to merge, or discard this patch.
src/ObservanceDecorator.php 2 patches
Indentation   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -20,12 +20,12 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@
 block discarded – undo
41 41
 
42 42
 	public function dateMatches(DateTimeInterface $date): bool
43 43
 	{
44
-		if (! $this->isWithinObservance((int) $date->format('Y'))) {
44
+		if (!$this->isWithinObservance((int) $date->format('Y'))) {
45 45
 			return false;
46 46
 		}
47 47
 
Please login to merge, or discard this patch.
src/IteratorItem/Easter.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@
 block discarded – undo
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 {
Please login to merge, or discard this patch.