Conditions | 3 |
Paths | 3 |
Total Lines | 12 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
28 | public static function ensureTraversable($items) |
||
29 | { |
||
30 | if ($items instanceof \Traversable) { |
||
31 | return $items; |
||
32 | } |
||
33 | |||
34 | if (is_array($items)) { |
||
35 | return self::fromArray($items); |
||
36 | } |
||
37 | |||
38 | throw new \InvalidArgumentException('Un-handled argument of type: '.get_class($items)); |
||
39 | } |
||
40 | |||
81 |