Conditions | 6 |
Paths | 6 |
Total Lines | 13 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
29 | public function getIterator(): Traversable |
||
30 | { |
||
31 | foreach ($this->iterables as $iterable) { |
||
32 | if (!is_iterable($iterable)) { |
||
33 | throw new \InvalidArgumentException('All iterables must be iterable.'); |
||
34 | } |
||
35 | if (true === $this->preserveKeys) { |
||
36 | foreach ($iterable as $key => $value) { |
||
37 | yield $key => $value; |
||
38 | } |
||
39 | } else { |
||
40 | foreach ($iterable as $value) { |
||
41 | yield $value; |
||
42 | } |
||
55 |