push
travis-ci
7003 of 7671 relevant lines covered (91.29%)
419.83 hits per line
1 |
<?php
|
|
2 |
|
|
3 |
namespace Pinq\Iterators\Generators; |
|
4 |
|
|
5 |
/**
|
|
6 |
* Implementation of the flattened iterator using generators. |
|
7 |
* |
|
8 |
* @author Elliot Levin <elliotlevin@hotmail.com> |
|
9 |
*/ |
|
10 |
class FlatteningIterator extends IteratorGenerator |
|
11 |
{ |
|
12 |
protected function &iteratorGenerator(IGenerator $iterator) |
|
13 |
{ |
× |
14 |
foreach ($iterator as $innerIterator) { |
236 all except 329.3 ✔ |
15 |
$innerIterator = GeneratorScheme::adapter($innerIterator); |
232 all except 329.3 ✔ |
16 |
|
|
17 |
foreach ($innerIterator as &$value) { |
232 all except 329.3 ✔ |
18 |
yield $value;
|
220 all except 329.3 ✔ |
19 |
} |
232 all except 329.3 ✔ |
20 |
} |
232 all except 329.3 ✔ |
21 |
} |
228 all except 329.3 ✔ |
22 |
} |