1 | <?php |
||
11 | class CacheItem implements CacheItemInterface |
||
12 | { |
||
13 | /** |
||
14 | * @var string |
||
15 | */ |
||
16 | private $key; |
||
17 | |||
18 | /** |
||
19 | * @var mixed|null |
||
20 | */ |
||
21 | private $value; |
||
22 | |||
23 | /** |
||
24 | * @var bool |
||
25 | */ |
||
26 | private $hit; |
||
27 | |||
28 | /** |
||
29 | * @var \DateTimeInterface |
||
30 | */ |
||
31 | private $expires; |
||
32 | |||
33 | /** |
||
34 | * @param string $key |
||
35 | * @param mixed $value |
||
36 | * @param bool $hit |
||
37 | */ |
||
38 | 67 | public function __construct($key, $value = null, $hit = false) |
|
44 | |||
45 | /** |
||
46 | * {@inheritdoc} |
||
47 | */ |
||
48 | 39 | public function getKey() |
|
52 | |||
53 | /** |
||
54 | * {@inheritdoc} |
||
55 | */ |
||
56 | 39 | public function get() |
|
60 | |||
61 | /** |
||
62 | * {@inheritdoc} |
||
63 | */ |
||
64 | 22 | public function isHit() |
|
68 | |||
69 | /** |
||
70 | * {@inheritdoc} |
||
71 | */ |
||
72 | 39 | public function set($value) |
|
78 | |||
79 | /** |
||
80 | * {@inheritdoc} |
||
81 | */ |
||
82 | 18 | public function expiresAt($expires) |
|
92 | |||
93 | /** |
||
94 | * {@inheritdoc} |
||
95 | */ |
||
96 | 5 | public function expiresAfter($time) |
|
108 | |||
109 | /** |
||
110 | * @return \DateTimeInterface |
||
111 | */ |
||
112 | 42 | public function getExpiresAt() |
|
116 | } |
||
117 |