| Conditions | 3 |
| Paths | 2 |
| Total Lines | 17 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 11 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 25 | 45 | public function toArray() |
|
| 26 | { |
||
| 27 | 45 | if ($this instanceof \Traversable) { |
|
| 28 | 44 | $array = iterator_to_array($this); |
|
| 29 | 44 | array_walk( |
|
| 30 | 44 | $array, |
|
| 31 | 44 | function (&$value) { |
|
| 32 | 44 | if ($value instanceof FiniteIterableInterface) { |
|
| 33 | 4 | $value = $value->toArray(); |
|
| 34 | } |
||
| 35 | 44 | } |
|
| 36 | ); |
||
| 37 | 44 | return $array; |
|
| 38 | } else { |
||
| 39 | 1 | return []; |
|
| 40 | } |
||
| 41 | } |
||
| 42 | } |
||
| 43 |