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