Conditions | 3 |
Paths | 3 |
Total Lines | 9 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 3 |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
19 | 799 | public static function makeIterator(iterable $iterable): \Iterator |
|
20 | { |
||
21 | switch (true) { |
||
22 | 799 | case $iterable instanceof \Iterator: |
|
23 | 358 | return $iterable; |
|
24 | 441 | case $iterable instanceof \Traversable: |
|
25 | 179 | return new \IteratorIterator($iterable); |
|
26 | default: |
||
27 | 262 | return new \ArrayIterator($iterable); |
|
|
|||
28 | } |
||
31 |