| Conditions | 1 |
| Paths | 1 |
| Total Lines | 27 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 1 |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 25 | 6 | public function __invoke(): Closure |
|
| 26 | { |
||
| 27 | 6 | $comparatorCallback = |
|
| 28 | /** |
||
| 29 | * @param T $left |
||
| 30 | * |
||
| 31 | * @return Closure(T): bool |
||
| 32 | */ |
||
| 33 | 6 | static fn (mixed $left): Closure => |
|
| 34 | /** |
||
| 35 | * @param T $right |
||
| 36 | */ |
||
| 37 | 6 | static fn (mixed $right): bool => $left === $right; |
|
| 38 | |||
| 39 | 6 | return |
|
| 40 | /** |
||
| 41 | * @param iterable<UKey, U> $items |
||
| 42 | * |
||
| 43 | * @return Closure(iterable<TKey, T>): iterable<int|TKey|UKey, T|U> |
||
| 44 | */ |
||
| 45 | 6 | static fn (iterable $items): Closure => |
|
| 46 | /** |
||
| 47 | * @param iterable<TKey, T> $iterable |
||
| 48 | * |
||
| 49 | * @return Generator<int|TKey|UKey, T|U> |
||
| 50 | */ |
||
| 51 | 6 | static fn (iterable $iterable): Generator => yield from (new Distinct())()($comparatorCallback)(static fn (mixed $value, mixed $key): mixed => $key)(new ConcatIterableAggregate([$iterable, $items])); |
|
| 52 | } |
||
| 54 |