Conditions | 3 |
Paths | 1 |
Total Lines | 20 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 3 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
21 | 2 | public function __invoke(): Closure |
|
22 | { |
||
23 | 2 | return |
|
24 | /** |
||
25 | * @param callable(T, TKey, iterable<TKey, T>): void ...$callbacks |
||
26 | * |
||
27 | * @return Closure(iterable<TKey, T>): Generator<TKey, T> |
||
28 | */ |
||
29 | 2 | static fn (callable ...$callbacks): Closure => /** |
|
30 | * @param iterable<TKey, T> $iterable |
||
31 | * |
||
32 | * @return Generator<TKey, T> |
||
33 | */ |
||
34 | 2 | static function (iterable $iterable) use ($callbacks): Generator { |
|
35 | 2 | foreach ($iterable as $key => $value) { |
|
36 | 2 | foreach ($callbacks as $callback) { |
|
37 | 2 | $callback($value, $key, $iterable); |
|
38 | } |
||
39 | |||
40 | 2 | yield $key => $value; |
|
41 | } |
||
45 |