Conditions | 2 |
Paths | 2 |
Total Lines | 11 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 2 |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
40 | 4 | static function fromArray($array, $save_indexes=true) |
|
41 | { |
||
42 | 4 | $splFixedArray = \SplFixedArray::fromArray($array, $save_indexes); |
|
43 | 4 | $cnt = count($array); |
|
44 | 4 | $self = new static($cnt); |
|
45 | 4 | foreach ($splFixedArray as $i => $v) { |
|
46 | 4 | $self[$i] = $v; |
|
47 | 4 | } |
|
48 | |||
49 | 4 | return $self; |
|
50 | } |
||
51 | |||
68 |
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.