| Conditions | 1 |
| Paths | 1 |
| Total Lines | 18 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 1 |
| Changes | 0 | ||
| 1 | <?php |
||
| 23 | 8 | public function __invoke(): Closure |
|
| 24 | { |
||
| 25 | 8 | return |
|
| 26 | /** |
||
| 27 | * @param callable((T|V), T, TKey, iterable<TKey, T>): (T|V) $callback |
||
| 28 | * |
||
| 29 | * @return Closure(iterable<TKey, T>): Generator<TKey|int, T|V> |
||
| 30 | */ |
||
| 31 | 8 | static function (callable $callback): Closure { |
|
| 32 | /** @var Closure(iterable<TKey, T>): Generator<TKey|int, T|V> $pipe */ |
||
| 33 | 8 | $pipe = (new Pipe())()( |
|
| 34 | 8 | (new Reverse())(), |
|
| 35 | 8 | (new ScanLeft1())()($callback), |
|
| 36 | 8 | (new Reverse())() |
|
| 37 | 8 | ); |
|
| 38 | |||
| 39 | // Point free style. |
||
| 40 | 8 | return $pipe; |
|
| 41 | 8 | }; |
|
| 44 |