1 | <?php |
||
9 | class Psr6CacheStorage implements CacheStorageInterface |
||
10 | { |
||
11 | /** |
||
12 | * The cache pool. |
||
13 | * |
||
14 | * @var CacheItemPoolInterface |
||
15 | */ |
||
16 | protected $cachePool; |
||
17 | |||
18 | /** |
||
19 | * The last item retrieved from the cache. |
||
20 | * |
||
21 | * This item is transiently stored so that save() can reuse the cache item |
||
22 | * usually retrieved by fetch() beforehand, instead of requesting it a second time. |
||
23 | * |
||
24 | * @var CacheItemInterface|null |
||
25 | */ |
||
26 | protected $lastItem; |
||
27 | |||
28 | /** |
||
29 | * @param CacheItemPoolInterface $cachePool |
||
30 | */ |
||
31 | 2 | public function __construct(CacheItemPoolInterface $cachePool) |
|
35 | |||
36 | /** |
||
37 | * {@inheritdoc} |
||
38 | */ |
||
39 | 2 | public function fetch($key) |
|
52 | |||
53 | /** |
||
54 | * {@inheritdoc} |
||
55 | */ |
||
56 | 2 | public function save($key, CacheEntry $data) |
|
78 | |||
79 | /** |
||
80 | * @param string $key |
||
81 | * |
||
82 | * @return bool |
||
83 | */ |
||
84 | 2 | public function delete($key) |
|
92 | } |
||
93 |