Total Complexity | 5 |
Total Lines | 34 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
23 | abstract class Repository |
||
24 | { |
||
25 | private $cache; |
||
26 | |||
27 | private $key; |
||
28 | |||
29 | 60 | public function __construct(Cache $cache, KeyBuilder $key) |
|
33 | 60 | } |
|
34 | |||
35 | abstract public static function getSuffix(): string; |
||
36 | |||
37 | 52 | public function forget(Owner $owner): void |
|
40 | 52 | } |
|
41 | |||
42 | 43 | protected function remember(Owner $owner, Closure $closure): Collection |
|
43 | { |
||
44 | 43 | $minutes = CacheConfig::getExpirationTime(); |
|
45 | 43 | return $this->cache->remember($this->keyFor($owner), $minutes, $closure); |
|
46 | } |
||
47 | |||
48 | 58 | protected function keyFor(Owner $owner): string |
|
51 | } |
||
52 | |||
53 | 43 | protected function parse(): Closure |
|
57 | 43 | }; |
|
58 | } |
||
60 |