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 |
||
14 | 97 | public static function makeIterator(iterable $iterable): \Iterator |
|
15 | { |
||
16 | switch (true) { |
||
17 | 97 | case $iterable instanceof \Iterator: |
|
18 | 46 | return $iterable; |
|
19 | 51 | case $iterable instanceof \Traversable: |
|
20 | 23 | return new \IteratorIterator($iterable); |
|
21 | default: |
||
22 | 28 | return new \ArrayIterator($iterable); |
|
|
|||
23 | } |
||
26 |