@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | { |
| 52 | 52 | for($j = 0; $j < $rowCount; $j++) |
| 53 | 53 | { |
| 54 | - $cell = $sheat->getCellByColumnAndRow($i+2, $j+4); |
|
| 54 | + $cell = $sheat->getCellByColumnAndRow($i + 2, $j + 4); |
|
| 55 | 55 | if($cell->isInMergeRange()) |
| 56 | 56 | { |
| 57 | 57 | continue; |
@@ -93,28 +93,28 @@ discard block |
||
| 93 | 93 | |
| 94 | 94 | protected function createShiftCell($sheat, $col, $row, $shift) |
| 95 | 95 | { |
| 96 | - $sheat->mergeCellsByColumnAndRow($col, $row, $col+$shift['length']-1, $row); |
|
| 96 | + $sheat->mergeCellsByColumnAndRow($col, $row, $col + $shift['length'] - 1, $row); |
|
| 97 | 97 | $this->setShiftNameInCell($sheat, $col, $row, $shift); |
| 98 | 98 | } |
| 99 | 99 | |
| 100 | 100 | protected function getRowForShift($roleID, $rows, $col, $sheat) |
| 101 | 101 | { |
| 102 | 102 | $firstRow = array_search($roleID, $rows); |
| 103 | - $cell = $sheat->getCellByColumnAndRow($col, $firstRow+4); |
|
| 103 | + $cell = $sheat->getCellByColumnAndRow($col, $firstRow + 4); |
|
| 104 | 104 | if($cell->isInMergeRange()) |
| 105 | 105 | { |
| 106 | - while($rows[$firstRow+$i] === $roleID) |
|
| 106 | + while($rows[$firstRow + $i] === $roleID) |
|
| 107 | 107 | { |
| 108 | - $cell = $sheat->getCellByColumnAndRow($hoursFromStart+2, $firstRow+4+$i); |
|
| 108 | + $cell = $sheat->getCellByColumnAndRow($hoursFromStart + 2, $firstRow + 4 + $i); |
|
| 109 | 109 | if(!$cell->isInMergeRange()) |
| 110 | 110 | { |
| 111 | 111 | break; |
| 112 | 112 | } |
| 113 | 113 | $i++; |
| 114 | 114 | } |
| 115 | - return $firstRow+4+$i; |
|
| 115 | + return $firstRow + 4 + $i; |
|
| 116 | 116 | } |
| 117 | - return $firstRow+4; |
|
| 117 | + return $firstRow + 4; |
|
| 118 | 118 | } |
| 119 | 119 | |
| 120 | 120 | protected function createSpreadSheet() |
@@ -161,7 +161,7 @@ discard block |
||
| 161 | 161 | $start = date_parse($str); |
| 162 | 162 | $lastShift = $shifts[$count - 1]; |
| 163 | 163 | $interval = $lastShift['endTime']->diff($shifts[0]['startTime']); |
| 164 | - $hourCount = ($interval->d*24) + $interval->h; |
|
| 164 | + $hourCount = ($interval->d * 24) + $interval->h; |
|
| 165 | 165 | $tmp = $this->getHoursArrays($start['hour'], $hourCount); |
| 166 | 166 | $simpleHours = $tmp[0]; |
| 167 | 167 | $militaryHours = $tmp[1]; |
@@ -232,13 +232,13 @@ discard block |
||
| 232 | 232 | { |
| 233 | 233 | $i = 1; |
| 234 | 234 | $timeDiff = $originalStartTime->diff($shift['startTime']); |
| 235 | - $hoursFromStart = ($timeDiff->d*24)+$timeDiff->h; |
|
| 236 | - $rowForShift = $this->getRowForShift($shift['roleID'], $rows, $hoursFromStart+2, $sheat); |
|
| 237 | - $this->createShiftCell($sheat, $hoursFromStart+2, $rowForShift, $shift); |
|
| 235 | + $hoursFromStart = ($timeDiff->d * 24) + $timeDiff->h; |
|
| 236 | + $rowForShift = $this->getRowForShift($shift['roleID'], $rows, $hoursFromStart + 2, $sheat); |
|
| 237 | + $this->createShiftCell($sheat, $hoursFromStart + 2, $rowForShift, $shift); |
|
| 238 | 238 | $shift = array_shift($shifts); |
| 239 | 239 | } |
| 240 | 240 | $rowCount = count($rows); |
| 241 | - $style = $sheat->getStyleByColumnAndRow(2, 4, 1+count($simpleHours), 3 + $rowCount); |
|
| 241 | + $style = $sheat->getStyleByColumnAndRow(2, 4, 1 + count($simpleHours), 3 + $rowCount); |
|
| 242 | 242 | $style->getBorders()->getAllBorders()->setBorderStyle(\PhpOffice\PhpSpreadsheet\Style\Border::BORDER_THIN); |
| 243 | 243 | $hourCount = count($simpleHours); |
| 244 | 244 | $this->grayOutUnused($hourCount, $rowCount, $sheat); |