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 |
||
75 | View Code Duplication | public function insertCells($cells, $position = null) |
|
76 | { |
||
77 | if ($position === null) { |
||
78 | $this->cells = array_merge($this->cells, $cells); |
||
79 | } else { |
||
80 | array_splice($this->cells, $position, 0, $cells); |
||
81 | } |
||
82 | } |
||
83 | } |
||
84 |
If a variable is not always an object, we recommend to add an additional type check to ensure your method call is safe: