Conditions | 2 |
Paths | 2 |
Total Lines | 10 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 2 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
14 | 72 | protected function cache(string $prefix, Closure $callback, $values = []) |
|
15 | { |
||
16 | 72 | if ($this->allowCache()) { |
|
17 | 6 | $key = $this->cacheKey($prefix, $values); |
|
18 | 6 | $ttl = $this->cacheTtl(); |
|
19 | |||
20 | 6 | return Cache::remember($key, $ttl, $callback); |
|
21 | } |
||
22 | |||
23 | 66 | return $callback(); |
|
24 | } |
||
52 |