| Conditions | 4 |
| Paths | 4 |
| Total Lines | 17 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 4 |
| Changes | 0 | ||
| 1 | <?php |
||
| 48 | 23 | public function fillMissingIndexesWithEmptyCells(Row $row) |
|
| 49 | { |
||
| 50 | 23 | if ($row->getNumCells() === 0) { |
|
| 51 | 1 | return $row; |
|
| 52 | } |
||
| 53 | |||
| 54 | 22 | $rowCells = $row->getCells(); |
|
| 55 | 22 | $maxCellIndex = max(array_keys($rowCells)); |
|
| 56 | |||
| 57 | 22 | for ($cellIndex = 0; $cellIndex < $maxCellIndex; $cellIndex++) { |
|
| 58 | 20 | if (!isset($rowCells[$cellIndex])) { |
|
| 59 | 2 | $row->setCellAtIndex($this->entityFactory->createCell(''), $cellIndex); |
|
| 60 | } |
||
| 61 | } |
||
| 62 | |||
| 63 | 22 | return $row; |
|
| 64 | } |
||
| 65 | } |
||
| 66 |