| Conditions | 2 |
| Paths | 2 |
| Total Lines | 8 |
| Code Lines | 5 |
| Lines | 8 |
| Ratio | 100 % |
| Tests | 0 |
| CRAP Score | 6 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 98 | View Code Duplication | public function insertCells($cells, $position = null) |
|
| 99 | { |
||
| 100 | if ($position === null) { |
||
| 101 | $this->cells = array_merge($this->cells, $cells); |
||
| 102 | } else { |
||
| 103 | array_splice($this->cells, $position, 0, $cells); |
||
| 104 | } |
||
| 105 | } |
||
| 106 | } |
||
| 107 |
If a variable is not always an object, we recommend to add an additional type check to ensure your method call is safe: