Conditions | 1 |
Paths | 1 |
Total Lines | 15 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Tests | 5 |
CRAP Score | 1 |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
13 | 2 | public static function fromClosure(Closure $closure, ?ArrayObject $cache = null): Closure |
|
14 | { |
||
15 | 2 | $cache ??= new ArrayObject(); |
|
16 | |||
17 | return |
||
18 | /** |
||
19 | * @psalm-suppress MixedAssignment |
||
20 | * |
||
21 | * @param mixed ...$arguments |
||
22 | * |
||
23 | * @return mixed |
||
24 | */ |
||
25 | 2 | static fn (...$arguments) => $cache[ |
|
26 | 2 | sha1(serialize($arguments)) |
|
27 | 2 | ] ??= ($closure)(...$arguments); |
|
28 | } |
||
30 |