Completed
Push — FVSv2 ( c17b7d...6cb237 )
by Patrick
01:37
created
app/Schedules/class.GridSchedule.php 2 patches
Indentation   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -46,17 +46,17 @@  discard block
 block discarded – undo
46 46
         {
47 47
             for($j = 0; $j < $rowCount; $j++)
48 48
             {
49
-                 $cell = $sheat->getCellByColumnAndRow($i+2, $j+4);
50
-                 if($cell->isInMergeRange())
51
-                 {
52
-                      continue;
53
-                 }
54
-                 else
55
-                 {
56
-                     $style = $cell->getStyle();
57
-                     $style->getBorders()->getAllBorders()->setBorderStyle(false);
58
-                     $style->getFill()->setFillType(\PhpOffice\PhpSpreadsheet\Style\Fill::FILL_PATTERN_LIGHTGRAY);
59
-                 }
49
+                    $cell = $sheat->getCellByColumnAndRow($i+2, $j+4);
50
+                    if($cell->isInMergeRange())
51
+                    {
52
+                        continue;
53
+                    }
54
+                    else
55
+                    {
56
+                        $style = $cell->getStyle();
57
+                        $style->getBorders()->getAllBorders()->setBorderStyle(false);
58
+                        $style->getFill()->setFillType(\PhpOffice\PhpSpreadsheet\Style\Fill::FILL_PATTERN_LIGHTGRAY);
59
+                    }
60 60
             }
61 61
         }
62 62
     }
@@ -86,15 +86,15 @@  discard block
 block discarded – undo
86 86
             $shifts[$i]['length'] = $diff->h;
87 87
             if(!isset($roles[$shifts[$i]['roleID']]))
88 88
             {
89
-                 $roles[$shifts[$i]['roleID']] = $shifts[$i]['length'];
90
-                 $roles2[$shifts[$i]['roleID']] = array();
89
+                    $roles[$shifts[$i]['roleID']] = $shifts[$i]['length'];
90
+                    $roles2[$shifts[$i]['roleID']] = array();
91 91
             }
92 92
             else
93 93
             {
94
-                 if($roles[$shifts[$i]['roleID']] < $shifts[$i]['length'])
95
-                 {
96
-                     $roles[$shifts[$i]['roleID']] = $shifts[$i]['length'];
97
-                 }
94
+                    if($roles[$shifts[$i]['roleID']] < $shifts[$i]['length'])
95
+                    {
96
+                        $roles[$shifts[$i]['roleID']] = $shifts[$i]['length'];
97
+                    }
98 98
             }
99 99
             array_push($roles2[$shifts[$i]['roleID']], array('start'=>$start, 'end'=>$end));
100 100
         }
Please login to merge, or discard this patch.
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
         {
47 47
             for($j = 0; $j < $rowCount; $j++)
48 48
             {
49
-                 $cell = $sheat->getCellByColumnAndRow($i+2, $j+4);
49
+                 $cell = $sheat->getCellByColumnAndRow($i + 2, $j + 4);
50 50
                  if($cell->isInMergeRange())
51 51
                  {
52 52
                       continue;
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
         $start = date_parse($str);
106 106
         $lastShift = $shifts[$count - 1];
107 107
         $interval = $lastShift['endTime']->diff($shifts[0]['startTime']);
108
-        $hourCount = ($interval->d*24) + $interval->h;
108
+        $hourCount = ($interval->d * 24) + $interval->h;
109 109
         $simpleHours = array();
110 110
         $militaryHours = array();
111 111
         $hour = $start['hour'];
@@ -186,38 +186,38 @@  discard block
 block discarded – undo
186 186
         {
187 187
             $i = 1;
188 188
             $timeDiff = $originalStartTime->diff($shift['startTime']);
189
-            $hoursFromStart = ($timeDiff->d*24)+$timeDiff->h;
189
+            $hoursFromStart = ($timeDiff->d * 24) + $timeDiff->h;
190 190
             $firstRow = array_search($shift['roleID'], $rows);
191
-            $cell = $sheat->getCellByColumnAndRow($hoursFromStart+2, $firstRow+4);
191
+            $cell = $sheat->getCellByColumnAndRow($hoursFromStart + 2, $firstRow + 4);
192 192
             if($cell->isInMergeRange())
193 193
             {
194
-                while($rows[$firstRow+$i] === $shift['roleID'])
194
+                while($rows[$firstRow + $i] === $shift['roleID'])
195 195
                 {
196
-                    $cell = $sheat->getCellByColumnAndRow($hoursFromStart+2, $firstRow+4+$i);
196
+                    $cell = $sheat->getCellByColumnAndRow($hoursFromStart + 2, $firstRow + 4 + $i);
197 197
                     if(!$cell->isInMergeRange())
198 198
                     {
199 199
                         break;
200 200
                     }
201 201
                     $i++;
202 202
                 }
203
-                $sheat->mergeCellsByColumnAndRow($hoursFromStart+2, $firstRow+4+$i, $hoursFromStart+1+$shift['length'], $firstRow+4+$i);
203
+                $sheat->mergeCellsByColumnAndRow($hoursFromStart + 2, $firstRow + 4 + $i, $hoursFromStart + 1 + $shift['length'], $firstRow + 4 + $i);
204 204
                 if(isset($shift['participant']))
205 205
                 {
206
-                    $sheat->setCellValueByColumnAndRow($hoursFromStart+2, $firstRow+4+$i, $this->getParticipantDiplayName($shift['participant']));
206
+                    $sheat->setCellValueByColumnAndRow($hoursFromStart + 2, $firstRow + 4 + $i, $this->getParticipantDiplayName($shift['participant']));
207 207
                 }
208 208
             }
209 209
             else
210 210
             {
211
-                $sheat->mergeCellsByColumnAndRow($hoursFromStart+2, $firstRow+4, $hoursFromStart+1+$shift['length'], $firstRow+4);
211
+                $sheat->mergeCellsByColumnAndRow($hoursFromStart + 2, $firstRow + 4, $hoursFromStart + 1 + $shift['length'], $firstRow + 4);
212 212
                 if(isset($shift['participant']))
213 213
                 {
214
-                    $sheat->setCellValueByColumnAndRow($hoursFromStart+2, $firstRow+4, $this->getParticipantDiplayName($shift['participant']));
214
+                    $sheat->setCellValueByColumnAndRow($hoursFromStart + 2, $firstRow + 4, $this->getParticipantDiplayName($shift['participant']));
215 215
                 }
216 216
             }
217 217
             $shift = array_shift($shifts);
218 218
         }
219 219
         $rowCount = count($rows);
220
-        $style = $sheat->getStyleByColumnAndRow(2, 4, 1+count($simpleHours), 3 + $rowCount);
220
+        $style = $sheat->getStyleByColumnAndRow(2, 4, 1 + count($simpleHours), 3 + $rowCount);
221 221
         $style->getBorders()->getAllBorders()->setBorderStyle(\PhpOffice\PhpSpreadsheet\Style\Border::BORDER_THIN);
222 222
         $hourCount = count($simpleHours);
223 223
         $this->grayOutUnused($hourCount, $rowCount, $sheat);
Please login to merge, or discard this patch.