| Total Complexity | 4 |
| Total Lines | 37 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 16 | class CacheStorage implements CacheStorageInterface |
||
| 17 | { |
||
| 18 | |||
| 19 | public $cache; |
||
| 20 | |||
| 21 | /** |
||
| 22 | * YiiCacheStorage constructor. |
||
| 23 | * |
||
| 24 | * @param mixed $cache Cache component. |
||
| 25 | */ |
||
| 26 | public function __construct($cache = 'cache') |
||
| 27 | { |
||
| 28 | $this->cache = $cache; |
||
| 29 | } |
||
| 30 | |||
| 31 | public function fetch($key) |
||
| 32 | { |
||
| 33 | /** @var \yii\caching\Cache $cache */ |
||
| 34 | $cache = Instance::ensure($this->cache, Cache::class); |
||
| 35 | |||
| 36 | return $cache->get($key); |
||
|
|
|||
| 37 | } |
||
| 38 | |||
| 39 | public function save($key, CacheEntry $data) |
||
| 45 | } |
||
| 46 | |||
| 47 | public function delete($key) |
||
| 53 | } |
||
| 54 | } |