@@ -134,10 +134,10 @@ discard block |
||
| 134 | 134 | $start = TRUE; |
| 135 | 135 | |
| 136 | 136 | // Cycle through each month |
| 137 | - foreach($daterange as $date) { |
|
| 137 | + foreach ($daterange as $date) { |
|
| 138 | 138 | |
| 139 | 139 | // Check if we have |
| 140 | - if (($date->format('Y-n') != $old_month) || ($start)) { |
|
| 140 | + if (($date->format('Y-n') != $old_month) || ($start)) { |
|
| 141 | 141 | |
| 142 | 142 | $year = $date->format("Y"); |
| 143 | 143 | $dayinterval = new \DateInterval('P1D'); |
@@ -231,7 +231,7 @@ discard block |
||
| 231 | 231 | } |
| 232 | 232 | |
| 233 | 233 | // Deal with the end date unless it ends just before midnight at which point we don't need to go further |
| 234 | - if ($this->event->getEndDate()->format('H:i') == '23:59' ) { |
|
| 234 | + if ($this->event->getEndDate()->format('H:i') == '23:59') { |
|
| 235 | 235 | $itemized[EventItemizer::BAT_HOUR][$ey][$em]['d' . $ed] = array(); |
| 236 | 236 | $itemized[EventItemizer::BAT_MINUTE][$ey][$em]['d' . $ed] = array(); |
| 237 | 237 | } else { |
@@ -259,14 +259,14 @@ discard block |
||
| 259 | 259 | |
| 260 | 260 | $counter = (int)$period_start->format('i'); |
| 261 | 261 | $start_minute = $counter; |
| 262 | - foreach($period as $minute) { |
|
| 262 | + foreach ($period as $minute) { |
|
| 263 | 263 | // Doing minutes so set the values in the minute array |
| 264 | - $itemized[EventItemizer::BAT_MINUTE][$minute->format('Y')][$minute->format('n')]['d'. $minute->format('j')]['h'. $minute->format('G')]['m' .$minute->format('i')] = $this->event->getValue(); |
|
| 264 | + $itemized[EventItemizer::BAT_MINUTE][$minute->format('Y')][$minute->format('n')]['d' . $minute->format('j')]['h' . $minute->format('G')]['m' . $minute->format('i')] = $this->event->getValue(); |
|
| 265 | 265 | // Let the hours know that it cannot determine availability |
| 266 | - $itemized[EventItemizer::BAT_HOUR][$minute->format('Y')][$minute->format('n')]['d'. $minute->format('j')]['h'. $minute->format('G')] = -1; |
|
| 266 | + $itemized[EventItemizer::BAT_HOUR][$minute->format('Y')][$minute->format('n')]['d' . $minute->format('j')]['h' . $minute->format('G')] = -1; |
|
| 267 | 267 | $counter++; |
| 268 | 268 | |
| 269 | - if ($counter == 60 && $start_minute!==0) { |
|
| 269 | + if ($counter == 60 && $start_minute !== 0) { |
|
| 270 | 270 | // Not a real hour - leave as is and move on |
| 271 | 271 | $counter = 0; |
| 272 | 272 | $start_minute = 0; |
@@ -275,7 +275,7 @@ discard block |
||
| 275 | 275 | // Did a real whole hour so initialize the hour |
| 276 | 276 | $itemized[EventItemizer::BAT_HOUR][$minute->format('Y')][$minute->format('n')]['d' . $minute->format('j')]['h' . $minute->format('G')] = $this->event->getValue(); |
| 277 | 277 | // We have a whole hour so get rid of the minute info |
| 278 | - unset($itemized[EventItemizer::BAT_MINUTE][$minute->format('Y')][$minute->format('n')]['d'. $minute->format('j')]['h'. $minute->format('G')]); |
|
| 278 | + unset($itemized[EventItemizer::BAT_MINUTE][$minute->format('Y')][$minute->format('n')]['d' . $minute->format('j')]['h' . $minute->format('G')]); |
|
| 279 | 279 | $counter = 0; |
| 280 | 280 | $start_minute = 0; |
| 281 | 281 | } |
@@ -147,8 +147,7 @@ discard block |
||
| 147 | 147 | // If we are in the same month the end date is the end date of the event |
| 148 | 148 | if ($this->event->isSameMonth()) { |
| 149 | 149 | $dayrange = new \DatePeriod($this->event->getStartDate(), $dayinterval, new \DateTime($this->event->getEndDate()->format("Y-n-j 23:59:59"))); |
| 150 | - } |
|
| 151 | - else { // alternatively it is the last day of the start month |
|
| 150 | + } else { // alternatively it is the last day of the start month |
|
| 152 | 151 | $dayrange = new \DatePeriod($this->event->getStartDate(), $dayinterval, $this->event->endMonthDate($this->event->getStartDate())); |
| 153 | 152 | } |
| 154 | 153 | foreach ($dayrange as $day) { |
@@ -214,8 +213,7 @@ discard block |
||
| 214 | 213 | $itemized[EventItemizer::BAT_HOUR][$sy][$sm]['d' . $sd] = $itemized_same_day[EventItemizer::BAT_HOUR][$sy][$sm]['d' . $sd]; |
| 215 | 214 | $itemized[EventItemizer::BAT_MINUTE][$sy][$sm]['d' . $sd] = $itemized_same_day[EventItemizer::BAT_MINUTE][$sy][$sm]['d' . $sd]; |
| 216 | 215 | } |
| 217 | - } |
|
| 218 | - else { |
|
| 216 | + } else { |
|
| 219 | 217 | // Deal with the start day unless it starts on midnight precisely at which point the whole day is booked |
| 220 | 218 | if (!($this->event->getStartDate()->format('H:i') == '00:00')) { |
| 221 | 219 | $start_period = new \DatePeriod($start_date, $interval, new \DateTime($start_date->format("Y-n-j 23:59:59"))); |
@@ -223,8 +221,7 @@ discard block |
||
| 223 | 221 | $itemized[EventItemizer::BAT_DAY][$sy][$sm]['d' . $sd] = -1; |
| 224 | 222 | $itemized[EventItemizer::BAT_HOUR][$sy][$sm]['d' . $sd] = $itemized_start[EventItemizer::BAT_HOUR][$sy][$sm]['d' . $sd]; |
| 225 | 223 | $itemized[EventItemizer::BAT_MINUTE][$sy][$sm]['d' . $sd] = $itemized_start[EventItemizer::BAT_MINUTE][$sy][$sm]['d' . $sd]; |
| 226 | - } |
|
| 227 | - else { |
|
| 224 | + } else { |
|
| 228 | 225 | // Just set an empty hour and minute |
| 229 | 226 | $itemized[EventItemizer::BAT_HOUR][$sy][$sm]['d' . $sd] = array(); |
| 230 | 227 | $itemized[EventItemizer::BAT_MINUTE][$sy][$sm]['d' . $sd] = array(); |
@@ -270,8 +267,7 @@ discard block |
||
| 270 | 267 | // Not a real hour - leave as is and move on |
| 271 | 268 | $counter = 0; |
| 272 | 269 | $start_minute = 0; |
| 273 | - } |
|
| 274 | - elseif ($counter == 60 && $start_minute == 0) { |
|
| 270 | + } elseif ($counter == 60 && $start_minute == 0) { |
|
| 275 | 271 | // Did a real whole hour so initialize the hour |
| 276 | 272 | $itemized[EventItemizer::BAT_HOUR][$minute->format('Y')][$minute->format('n')]['d' . $minute->format('j')]['h' . $minute->format('G')] = $this->event->getValue(); |
| 277 | 273 | // We have a whole hour so get rid of the minute info |
@@ -342,8 +342,7 @@ |
||
| 342 | 342 | if ($this->dateIsEarlier($start) && |
| 343 | 343 | ($this->dateIsInRange($end) || $this->dateIsLater($end))) { |
| 344 | 344 | $overlaps = TRUE; |
| 345 | - } |
|
| 346 | - elseif ($this->dateIsInRange($start) && |
|
| 345 | + } elseif ($this->dateIsInRange($start) && |
|
| 347 | 346 | ($this->dateIsInRange($end) || $this->dateIsLater($end))) { |
| 348 | 347 | $overlaps = TRUE; |
| 349 | 348 | } |