Conditions | 2 |
Paths | 2 |
Total Lines | 11 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 2 |
Changes | 2 | ||
Bugs | 1 | Features | 0 |
1 | <?php |
||
18 | 100 | public function run(\Closure $closure, array $parameters = []) |
|
19 | { |
||
20 | 100 | $cachableParameters = $this->convertToCachableParameters($parameters); |
|
21 | |||
22 | 100 | $cachekey = $this->baseKey.':'.md5(implode('', $cachableParameters)); |
|
23 | |||
24 | 100 | if (isset(static::$cache[$cachekey])) { |
|
25 | 70 | return static::$cache[$cachekey]; |
|
26 | } |
||
27 | |||
28 | 100 | return static::$cache[$cachekey] = call_user_func_array($closure, $parameters); |
|
29 | } |
||
47 |