| Conditions | 2 |
| Paths | 1 |
| Total Lines | 15 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 5 |
| CRAP Score | 2 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 31 | 2 | public static function of(): Closure |
|
| 32 | { |
||
| 33 | return |
||
| 34 | /** |
||
| 35 | * @param callable(T, TKey, iterable<TKey, T>): U $callable |
||
| 36 | */ |
||
| 37 | 2 | static fn (callable $callable): Closure => |
|
| 38 | /** |
||
| 39 | * @param iterable<TKey, T> $iterable |
||
| 40 | * |
||
| 41 | * @return Generator<TKey, U> |
||
| 42 | */ |
||
| 43 | 2 | static function (iterable $iterable) use ($callable): Generator { |
|
| 44 | 2 | foreach ($iterable as $key => $item) { |
|
| 45 | 2 | yield $key => $callable($item, $key, $iterable); |
|
| 46 | } |
||
| 50 |