@@ -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,12 +57,10 @@ 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 | if (isset($this->constraints[$constraint_class])) { |
64 | 62 | $classes = array($constraint_class); |
65 | - } |
|
66 | - else { |
|
63 | + } else { |
|
67 | 64 | return array(); |
68 | 65 | } |
69 | 66 | } |
@@ -89,8 +86,7 @@ discard block |
||
89 | 86 | |
90 | 87 | if ($constraint_class == NULL) { |
91 | 88 | return $new_constraints; |
92 | - } |
|
93 | - else { |
|
89 | + } else { |
|
94 | 90 | return $new_constraints[$constraint_class]; |
95 | 91 | } |
96 | 92 | } |
@@ -119,12 +115,10 @@ discard block |
||
119 | 115 | if ($start_date >= $new_start_date && $start_date <= $new_end_date) { |
120 | 116 | $new_end_date_clone = clone($new_end_date); |
121 | 117 | $constraint->setStartDate($new_end_date_clone->add(new \DateInterval('P1D'))); |
122 | - } |
|
123 | - elseif ($end_date >= $new_start_date && $end_date <= $new_end_date) { |
|
118 | + } elseif ($end_date >= $new_start_date && $end_date <= $new_end_date) { |
|
124 | 119 | $new_start_date_clone = clone($new_start_date); |
125 | 120 | $constraint->setEndDate($new_start_date_clone->sub(new \DateInterval('P1D'))); |
126 | - } |
|
127 | - elseif ($start_date < $new_start_date && $end_date > $new_end_date) { |
|
121 | + } elseif ($start_date < $new_start_date && $end_date > $new_end_date) { |
|
128 | 122 | if ($constraint->getEndDate() > $new_start_date) { |
129 | 123 | $new_start_date_clone = clone($new_start_date); |
130 | 124 | $constraint->setEndDate($new_start_date_clone->sub(new \DateInterval('P1D'))); |
@@ -136,8 +130,7 @@ discard block |
||
136 | 130 | $split_end_date = $end_date; |
137 | 131 | |
138 | 132 | $split_constraint = new MinMaxDaysConstraint($constraint->getUnits(), $constraint->getMinDays(), $constraint->getMaxDays(), $split_start_date, $split_end_date, $constraint->getCheckinDay()); |
139 | - } |
|
140 | - else { |
|
133 | + } else { |
|
141 | 134 | $split_start_date = $split_constraint->getStartDate(); |
142 | 135 | $split_end_date = $split_constraint->getEndDate(); |
143 | 136 | |
@@ -194,12 +187,10 @@ discard block |
||
194 | 187 | if ($start_date >= $new_start_date && $start_date <= $new_end_date) { |
195 | 188 | $new_end_date_clone = clone($new_end_date); |
196 | 189 | $constraint->setStartDate($new_end_date_clone->add(new \DateInterval('P1D'))); |
197 | - } |
|
198 | - elseif ($end_date >= $new_start_date && $end_date <= $new_end_date) { |
|
190 | + } elseif ($end_date >= $new_start_date && $end_date <= $new_end_date) { |
|
199 | 191 | $new_start_date_clone = clone($new_start_date); |
200 | 192 | $constraint->setEndDate($new_start_date_clone->sub(new \DateInterval('P1D'))); |
201 | - } |
|
202 | - elseif ($start_date < $new_start_date && $end_date > $new_end_date) { |
|
193 | + } elseif ($start_date < $new_start_date && $end_date > $new_end_date) { |
|
203 | 194 | if ($constraint->getEndDate() > $new_start_date) { |
204 | 195 | $new_start_date_clone = clone($new_start_date); |
205 | 196 | $constraint->setEndDate($new_start_date_clone->sub(new \DateInterval('P1D'))); |
@@ -211,8 +202,7 @@ discard block |
||
211 | 202 | $split_end_date = $end_date; |
212 | 203 | |
213 | 204 | $split_constraint = new CheckInDayConstraint($constraint->getUnits(), $constraint->getCheckinDay(), $split_start_date, $split_end_date); |
214 | - } |
|
215 | - else { |
|
205 | + } else { |
|
216 | 206 | $split_start_date = $split_constraint->getStartDate(); |
217 | 207 | $split_end_date = $split_constraint->getEndDate(); |
218 | 208 |