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