Conditions | 1 |
Paths | 1 |
Total Lines | 26 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 10 |
CRAP Score | 1 |
Changes | 3 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
23 | 8 | public function __invoke(): Closure |
|
24 | { |
||
25 | 8 | $callbackForKeys = |
|
26 | /** |
||
27 | * @param non-empty-array<int, TKey> $key |
||
|
|||
28 | * |
||
29 | * @return TKey |
||
30 | */ |
||
31 | 8 | static fn (array $key): mixed => reset($key); |
|
32 | |||
33 | 8 | $callbackForValues = |
|
34 | /** |
||
35 | * @param array<int, T> $value |
||
36 | * |
||
37 | * @return array<int, T> |
||
38 | */ |
||
39 | 8 | static fn (array $value): array => $value; |
|
40 | |||
41 | /** @var Closure(iterable<TKey, T>): Generator<TKey, list<T>> $pipe */ |
||
42 | 8 | $pipe = (new Pipe())()( |
|
43 | 8 | static fn (iterable $iterables): MultipleIterableAggregate => new MultipleIterableAggregate($iterables, MultipleIterator::MIT_NEED_ANY), |
|
44 | 8 | (new Associate())()($callbackForKeys)($callbackForValues) |
|
45 | 8 | ); |
|
46 | |||
47 | // Point free style. |
||
48 | 8 | return $pipe; |
|
49 | } |
||
51 |