Conditions | 1 |
Paths | 1 |
Total Lines | 15 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 5 |
CRAP Score | 1 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
28 | 4 | public static function of(): Closure |
|
29 | { |
||
30 | return |
||
31 | /** |
||
32 | * @psalm-param positive-int|null $arity |
||
33 | */ |
||
34 | 4 | static fn (callable $callable, ?int $arity = null): Closure => |
|
35 | /** |
||
36 | * @psalm-param mixed ...$args |
||
37 | * @return mixed |
||
38 | */ |
||
39 | 4 | static fn (...$args) => static::curryN( |
|
40 | 4 | ($arity ?? (new ReflectionFunction($callable))->getNumberOfRequiredParameters()) - count($args), |
|
41 | $callable, |
||
42 | 4 | static::getArguments([], $args) |
|
43 | 4 | ); |
|
69 |