Conditions | 2 |
Paths | 1 |
Total Lines | 23 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Changes | 8 | ||
Bugs | 1 | Features | 3 |
1 | <?php |
||
25 | public function __construct( |
||
26 | Iterator|Closure $origin, |
||
27 | AddingIterator $target |
||
28 | ) { |
||
29 | /** |
||
30 | * @todo #194:15min README has to show that it is now possible to |
||
31 | * directly pass Generator Closures into constructor without |
||
32 | * having to manually call them. |
||
33 | */ |
||
34 | parent::__construct( |
||
35 | /** @phpstan-ignore-next-line */ |
||
36 | new ContextVeil( |
||
37 | $target, |
||
38 | new ClosureReaction( |
||
39 | fn (AddingIterator $stored) => (new ValidTernary( |
||
40 | ($origin instanceof Closure) ? $origin() : $origin, |
||
41 | function (Iterator $source) use ($stored) { |
||
42 | $temp = $stored->from($source); |
||
43 | $source->next(); |
||
44 | return $temp; |
||
45 | }, |
||
46 | fn () => $stored |
||
47 | ))->value() |
||
48 | ) |
||
53 |