| Conditions | 1 |
| Paths | 1 |
| Total Lines | 15 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 1 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 24 | 18 | public function __invoke(): Closure |
|
| 25 | { |
||
| 26 | 18 | return |
|
| 27 | /** |
||
| 28 | * @param callable(T, TKey, iterable<TKey, T>): iterable<mixed, mixed> $callback |
||
| 29 | */ |
||
| 30 | 18 | static function (callable $callback): Closure { |
|
| 31 | /** @var Closure(iterable<TKey, T>): Generator<IKey, IValue> $flatMap */ |
||
| 32 | 18 | $flatMap = (new Pipe())()( |
|
| 33 | 18 | (new Map())()($callback), |
|
| 34 | 18 | (new Flatten())()(1), |
|
| 35 | 18 | ); |
|
| 36 | |||
| 37 | // Point free style |
||
| 38 | 18 | return $flatMap; |
|
| 39 | 18 | }; |
|
| 42 |