diff options
author | Bot <bot@myigel.name> | 2017-01-02 03:57:23 +0100 |
---|---|---|
committer | Igor Scheller <igor.scheller@igorshp.de> | 2017-01-02 03:57:23 +0100 |
commit | 7313e15ce8236e19331fb6639a3a5b97c8f06ecd (patch) | |
tree | 399e5eaa403d6dd5993ca8fb6f2162319d2ed2e1 /includes/view/ShiftCalendarLane.php | |
parent | b839e401062b294292fdcbd7e30b79bc149fab6f (diff) |
PSR-2 formatting
Diffstat (limited to 'includes/view/ShiftCalendarLane.php')
-rw-r--r-- | includes/view/ShiftCalendarLane.php | 64 |
1 files changed, 34 insertions, 30 deletions
diff --git a/includes/view/ShiftCalendarLane.php b/includes/view/ShiftCalendarLane.php index 33fccec3..af674671 100644 --- a/includes/view/ShiftCalendarLane.php +++ b/includes/view/ShiftCalendarLane.php @@ -5,21 +5,22 @@ namespace Engelsystem; /** * Represents a single lane in a shifts calendar. */ -class ShiftCalendarLane { +class ShiftCalendarLane +{ + private $firstBlockStartTime; - private $firstBlockStartTime; + private $blockCount; - private $blockCount; + private $header; - private $header; + private $shifts = []; - private $shifts = []; - - public function __construct($header, $firstBlockStartTime, $blockCount) { - $this->header = $header; - $this->firstBlockStartTime = $firstBlockStartTime; - $this->blockCount = $blockCount; - } + public function __construct($header, $firstBlockStartTime, $blockCount) + { + $this->header = $header; + $this->firstBlockStartTime = $firstBlockStartTime; + $this->blockCount = $blockCount; + } /** * Adds a shift to the lane, but only if it fits. @@ -29,12 +30,13 @@ class ShiftCalendarLane { * The shift to add * @return boolean true on success */ - public function addShift($shift) { - if ($this->shiftFits($shift)) { - $this->shifts[] = $shift; - return true; - } - return false; + public function addShift($shift) + { + if ($this->shiftFits($shift)) { + $this->shifts[] = $shift; + return true; + } + return false; } /** @@ -43,21 +45,23 @@ class ShiftCalendarLane { * @param Shift $shift * The shift to fit into this lane */ - public function shiftFits($newShift) { - foreach ($this->shifts as $laneShift) { - if (! ($newShift['start'] >= $laneShift['end'] || $newShift['end'] <= $laneShift['start'])) { - return false; + public function shiftFits($newShift) + { + foreach ($this->shifts as $laneShift) { + if (! ($newShift['start'] >= $laneShift['end'] || $newShift['end'] <= $laneShift['start'])) { + return false; + } } - } - return true; + return true; } - public function getHeader() { - return $this->header; - } + public function getHeader() + { + return $this->header; + } - public function getShifts() { - return $this->shifts; - } + public function getShifts() + { + return $this->shifts; + } } -?>
\ No newline at end of file |