| Total Complexity | 3 |
| Total Lines | 36 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 14 | trait CachePoolAwareTrait |
||
| 15 | { |
||
| 16 | /** |
||
| 17 | * Store the PSR-6 caching service. |
||
| 18 | * |
||
| 19 | * @var CacheItemPoolInterface |
||
| 20 | */ |
||
| 21 | private $cachePool; |
||
| 22 | |||
| 23 | /** |
||
| 24 | * Set the cache pool manager. |
||
| 25 | * |
||
| 26 | * @param CacheItemPoolInterface $cache A PSR-6 compliant cache pool instance. |
||
| 27 | * @return void |
||
| 28 | */ |
||
| 29 | protected function setCachePool(CacheItemPoolInterface $cache) |
||
| 30 | { |
||
| 31 | $this->cachePool = $cache; |
||
| 32 | } |
||
| 33 | |||
| 34 | /** |
||
| 35 | * Retrieve the cache service. |
||
| 36 | * |
||
| 37 | * @throws RuntimeException If the cache service was not previously set. |
||
| 38 | * @return CacheItemPoolInterface |
||
| 39 | */ |
||
| 40 | protected function cachePool() |
||
| 50 | } |
||
| 51 | } |
||
| 52 |