@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | /** |
| 91 | 91 | * Returns the start date. |
| 92 | 92 | * |
| 93 | - * @return DateTime |
|
| 93 | + * @return \DateTime |
|
| 94 | 94 | */ |
| 95 | 95 | public function getStartDate() { |
| 96 | 96 | return clone($this->start_date); |
@@ -107,7 +107,7 @@ discard block |
||
| 107 | 107 | /** |
| 108 | 108 | * Set the start date. |
| 109 | 109 | * |
| 110 | - * @param DateTime $start_date |
|
| 110 | + * @param \DateTime $start_date |
|
| 111 | 111 | */ |
| 112 | 112 | public function setStartDate(\DateTime $start_date) { |
| 113 | 113 | $this->start_date = clone($start_date); |
@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | /** |
| 117 | 117 | * Returns the end date. |
| 118 | 118 | * |
| 119 | - * @return DateTime |
|
| 119 | + * @return \DateTime |
|
| 120 | 120 | */ |
| 121 | 121 | public function getEndDate() { |
| 122 | 122 | return clone($this->end_date); |
@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | /** |
| 134 | 134 | * Set the end date. |
| 135 | 135 | * |
| 136 | - * @param DateTime $end_date |
|
| 136 | + * @param \DateTime $end_date |
|
| 137 | 137 | */ |
| 138 | 138 | public function setEndDate(\DateTime $end_date) { |
| 139 | 139 | $this->end_date = clone($end_date); |
@@ -245,6 +245,7 @@ discard block |
||
| 245 | 245 | |
| 246 | 246 | /** |
| 247 | 247 | * {@inheritdoc} |
| 248 | + * @param \DateTime $date |
|
| 248 | 249 | */ |
| 249 | 250 | public function isLastMonth($date) { |
| 250 | 251 | if ($date->format("n") == $this->endMonth() && $date->format("Y") == $this->endYear()) { |
@@ -622,7 +623,7 @@ discard block |
||
| 622 | 623 | /** |
| 623 | 624 | * Saves an event using the Store object |
| 624 | 625 | * |
| 625 | - * @param \Roomify\Bat\\Store\Store $store |
|
| 626 | + * @param Store $store |
|
| 626 | 627 | * @param string $granularity |
| 627 | 628 | * |
| 628 | 629 | * @return boolean |
@@ -342,8 +342,7 @@ discard block |
||
| 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 | } |
@@ -478,8 +477,7 @@ discard block |
||
| 478 | 477 | $itemized[AbstractEvent::BAT_HOUR][$sy][$sm]['d' . $sd] = $itemized_same_day[AbstractEvent::BAT_HOUR][$sy][$sm]['d' . $sd]; |
| 479 | 478 | $itemized[AbstractEvent::BAT_MINUTE][$sy][$sm]['d' . $sd] = $itemized_same_day[AbstractEvent::BAT_MINUTE][$sy][$sm]['d' . $sd]; |
| 480 | 479 | } |
| 481 | - } |
|
| 482 | - else { |
|
| 480 | + } else { |
|
| 483 | 481 | // Deal with the start day unless it starts on midnight precisely at which point the whole day is booked |
| 484 | 482 | if (!($this->start_date->format('H:i') == '00:00')) { |
| 485 | 483 | $start_period = new \DatePeriod($start_date, $interval, new \DateTime($start_date->format("Y-n-j 23:59:59"))); |
@@ -487,8 +485,7 @@ discard block |
||
| 487 | 485 | $itemized[AbstractEvent::BAT_DAY][$sy][$sm]['d' . $sd] = -1; |
| 488 | 486 | $itemized[AbstractEvent::BAT_HOUR][$sy][$sm]['d' . $sd] = $itemized_start[AbstractEvent::BAT_HOUR][$sy][$sm]['d' . $sd]; |
| 489 | 487 | $itemized[AbstractEvent::BAT_MINUTE][$sy][$sm]['d' . $sd] = $itemized_start[AbstractEvent::BAT_MINUTE][$sy][$sm]['d' . $sd]; |
| 490 | - } |
|
| 491 | - else { |
|
| 488 | + } else { |
|
| 492 | 489 | // Just set an empty hour and minute |
| 493 | 490 | $itemized[AbstractEvent::BAT_HOUR][$sy][$sm]['d' . $sd] = array(); |
| 494 | 491 | $itemized[AbstractEvent::BAT_MINUTE][$sy][$sm]['d' . $sd] = array(); |
@@ -533,8 +530,7 @@ discard block |
||
| 533 | 530 | // Not a real hour - leave as is and move on |
| 534 | 531 | $counter = 0; |
| 535 | 532 | $start_minute = 0; |
| 536 | - } |
|
| 537 | - elseif ($counter == 60 && $start_minute == 0) { |
|
| 533 | + } elseif ($counter == 60 && $start_minute == 0) { |
|
| 538 | 534 | // Did a real whole hour so initialize the hour |
| 539 | 535 | $itemized[AbstractEvent::BAT_HOUR][$minute->format('Y')][$minute->format('n')]['d' . $minute->format('j')]['h' . $minute->format('G')] = $this->getValue(); |
| 540 | 536 | // We have a whole hour so get rid of the minute info |
@@ -582,8 +578,7 @@ discard block |
||
| 582 | 578 | // If we are in the same month the end date is the end date of the event |
| 583 | 579 | if ($this->isSameMonth()) { |
| 584 | 580 | $dayrange = new \DatePeriod($this->start_date, $dayinterval, new \DateTime($this->end_date->format("Y-n-j 23:59:59"))); |
| 585 | - } |
|
| 586 | - else { // alternatively it is the last day of the start month |
|
| 581 | + } else { // alternatively it is the last day of the start month |
|
| 587 | 582 | $dayrange = new \DatePeriod($this->start_date, $dayinterval, $this->endMonthDate($this->start_date)); |
| 588 | 583 | } |
| 589 | 584 | foreach ($dayrange as $day) { |