Conditions | 2 |
Paths | 2 |
Total Lines | 10 |
Code Lines | 3 |
Lines | 0 |
Ratio | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 2 |
1 | <?php |
||
35 | public function from(Iterator $source): AddingIterator |
||
36 | { |
||
37 | /** |
||
38 | * @todo #66:20min Add a decorator for AddingIterator which does not |
||
39 | * allow to add values if source is not valid. |
||
40 | */ |
||
41 | if ($source->valid()) { |
||
42 | $this->added[$source->key()] ??= $source->current(); |
||
43 | } |
||
44 | return new self($this->added); |
||
45 | } |
||
88 |