Conditions | 3 |
Paths | 3 |
Total Lines | 12 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
34 | private function mapToColumns($row) { |
||
35 | $record = []; |
||
36 | foreach($row as $i => $value) |
||
37 | { |
||
38 | if(isset($this->columns[$i])) { |
||
39 | $record[$this->columns[$i]] = $value; |
||
40 | } else { |
||
41 | throw new \LogicException("Row contains invalid column #$i\n" . var_export($row, true)); |
||
42 | } |
||
43 | } |
||
44 | return $record; |
||
45 | } |
||
46 | |||
71 |
Adding explicit visibility (
private
,protected
, orpublic
) is generally recommend to communicate to other developers how, and from where this method is intended to be used.