@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | protected function normalizeMinMaxDaysConstraints() { |
97 | 97 | $new_constraints = array(); |
98 | 98 | |
99 | - $constraints = array_map(function ($object) { return clone $object; }, $this->constraints['Roomify\Bat\Constraint\MinMaxDaysConstraint']); |
|
99 | + $constraints = array_map(function($object) { return clone $object; }, $this->constraints['Roomify\Bat\Constraint\MinMaxDaysConstraint']); |
|
100 | 100 | |
101 | 101 | foreach (array_reverse($constraints) as $constraint) { |
102 | 102 | $start_date = $constraint->getStartDate(); |
@@ -172,7 +172,7 @@ discard block |
||
172 | 172 | protected function normalizeCheckInDayConstraints() { |
173 | 173 | $new_constraints = array(); |
174 | 174 | |
175 | - $constraints = array_map(function ($object) { return clone $object; }, $this->constraints['Roomify\Bat\Constraint\CheckInDayConstraint']); |
|
175 | + $constraints = array_map(function($object) { return clone $object; }, $this->constraints['Roomify\Bat\Constraint\CheckInDayConstraint']); |
|
176 | 176 | |
177 | 177 | foreach (array_reverse($constraints) as $constraint) { |
178 | 178 | $start_date = $constraint->getStartDate(); |
@@ -27,8 +27,7 @@ discard block |
||
27 | 27 | public function getConstraints($constraint_class = NULL) { |
28 | 28 | if ($constraint_class == NULL) { |
29 | 29 | return $this->constraint; |
30 | - } |
|
31 | - else { |
|
30 | + } else { |
|
32 | 31 | return $this->constraint[$constraint_class]; |
33 | 32 | } |
34 | 33 | } |
@@ -58,8 +57,7 @@ discard block |
||
58 | 57 | public function normalizeConstraints($constraint_class = NULL) { |
59 | 58 | if ($constraint_class == NULL) { |
60 | 59 | $classes = array_keys($this->constraints); |
61 | - } |
|
62 | - else { |
|
60 | + } else { |
|
63 | 61 | $classes = array($constraint_class); |
64 | 62 | } |
65 | 63 | |
@@ -84,8 +82,7 @@ discard block |
||
84 | 82 | |
85 | 83 | if ($constraint_class == NULL) { |
86 | 84 | return $new_constraints; |
87 | - } |
|
88 | - else { |
|
85 | + } else { |
|
89 | 86 | return $new_constraints[$constraint_class]; |
90 | 87 | } |
91 | 88 | } |
@@ -114,12 +111,10 @@ discard block |
||
114 | 111 | if ($start_date >= $new_start_date && $start_date <= $new_end_date) { |
115 | 112 | $new_end_date_clone = clone($new_end_date); |
116 | 113 | $constraint->setStartDate($new_end_date_clone->add(new \DateInterval('P1D'))); |
117 | - } |
|
118 | - elseif ($end_date >= $new_start_date && $end_date <= $new_end_date) { |
|
114 | + } elseif ($end_date >= $new_start_date && $end_date <= $new_end_date) { |
|
119 | 115 | $new_start_date_clone = clone($new_start_date); |
120 | 116 | $constraint->setEndDate($new_start_date_clone->sub(new \DateInterval('P1D'))); |
121 | - } |
|
122 | - elseif ($start_date < $new_start_date && $end_date > $new_end_date) { |
|
117 | + } elseif ($start_date < $new_start_date && $end_date > $new_end_date) { |
|
123 | 118 | if ($constraint->getEndDate() > $new_start_date) { |
124 | 119 | $new_start_date_clone = clone($new_start_date); |
125 | 120 | $constraint->setEndDate($new_start_date_clone->sub(new \DateInterval('P1D'))); |
@@ -131,8 +126,7 @@ discard block |
||
131 | 126 | $split_end_date = $end_date; |
132 | 127 | |
133 | 128 | $split_constraint = new MinMaxDaysConstraint($constraint->getUnits(), $constraint->getMinDays(), $constraint->getMaxDays(), $split_start_date, $split_end_date, $constraint->getCheckinDay()); |
134 | - } |
|
135 | - else { |
|
129 | + } else { |
|
136 | 130 | $split_start_date = $split_constraint->getStartDate(); |
137 | 131 | $split_end_date = $split_constraint->getEndDate(); |
138 | 132 | |
@@ -189,12 +183,10 @@ discard block |
||
189 | 183 | if ($start_date >= $new_start_date && $start_date <= $new_end_date) { |
190 | 184 | $new_end_date_clone = clone($new_end_date); |
191 | 185 | $constraint->setStartDate($new_end_date_clone->add(new \DateInterval('P1D'))); |
192 | - } |
|
193 | - elseif ($end_date >= $new_start_date && $end_date <= $new_end_date) { |
|
186 | + } elseif ($end_date >= $new_start_date && $end_date <= $new_end_date) { |
|
194 | 187 | $new_start_date_clone = clone($new_start_date); |
195 | 188 | $constraint->setEndDate($new_start_date_clone->sub(new \DateInterval('P1D'))); |
196 | - } |
|
197 | - elseif ($start_date < $new_start_date && $end_date > $new_end_date) { |
|
189 | + } elseif ($start_date < $new_start_date && $end_date > $new_end_date) { |
|
198 | 190 | if ($constraint->getEndDate() > $new_start_date) { |
199 | 191 | $new_start_date_clone = clone($new_start_date); |
200 | 192 | $constraint->setEndDate($new_start_date_clone->sub(new \DateInterval('P1D'))); |
@@ -206,8 +198,7 @@ discard block |
||
206 | 198 | $split_end_date = $end_date; |
207 | 199 | |
208 | 200 | $split_constraint = new CheckInDayConstraint($constraint->getUnits(), $constraint->getCheckinDay(), $split_start_date, $split_end_date); |
209 | - } |
|
210 | - else { |
|
201 | + } else { |
|
211 | 202 | $split_start_date = $split_constraint->getStartDate(); |
212 | 203 | $split_end_date = $split_constraint->getEndDate(); |
213 | 204 |