Total Complexity | 3 |
Total Lines | 38 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
14 | class BufferCollection extends MemoryStoreCollection |
||
15 | { |
||
16 | /** |
||
17 | * @var Buffer |
||
18 | */ |
||
19 | protected $cache; |
||
20 | |||
21 | /** |
||
22 | * @param string $name |
||
23 | */ |
||
24 | public function __construct(Buffer $cache, $name) |
||
25 | { |
||
26 | parent::__construct($cache, $name); |
||
27 | } |
||
28 | |||
29 | /** |
||
30 | * Check if a key existed in local storage, but is now expired. |
||
31 | * |
||
32 | * Because our local buffer is also just a real cache, expired items will |
||
33 | * just return nothing, which will lead us to believe no such item exists in |
||
34 | * that local cache, and we'll reach out to the real cache (where the value |
||
35 | * may not yet have been expired because that may have been part of an |
||
36 | * uncommitted write) |
||
37 | * So we'll want to know when a value is in local cache, but expired! |
||
38 | * |
||
39 | * @param string $key |
||
40 | * |
||
41 | * @return bool |
||
42 | */ |
||
43 | public function expired($key) |
||
52 | } |
||
53 | } |
||
54 |