Total Complexity | 3 |
Total Lines | 33 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php declare(strict_types=1); |
||
8 | trait CacheAwareTrait |
||
9 | { |
||
10 | /** @var CacheInterface */ |
||
11 | protected $cache; |
||
12 | |||
13 | /** @var string */ |
||
14 | protected $cacheKey = 'routes'; |
||
15 | |||
16 | /** @var null|int|DateInterval */ |
||
17 | protected $cacheTTL; |
||
18 | |||
19 | /** |
||
20 | * @inheritDoc |
||
21 | */ |
||
22 | 4 | public function setCache(CacheInterface $cache): void |
|
23 | { |
||
24 | 4 | $this->cache = $cache; |
|
25 | 4 | } |
|
26 | |||
27 | /** |
||
28 | * @inheritDoc |
||
29 | */ |
||
30 | 1 | public function setCacheKey(string $key = 'routes'): void |
|
33 | 1 | } |
|
34 | |||
35 | /** |
||
36 | * @inheritDoc |
||
37 | */ |
||
38 | 1 | public function setCacheTTL($ttl = 60): void |
|
41 | 1 | } |
|
42 | } |
||
43 |