| 1 | <?php |
||
| 9 | class CacheItem implements CacheItemInterface |
||
| 10 | { |
||
| 11 | /** |
||
| 12 | * @var string |
||
| 13 | */ |
||
| 14 | private $key; |
||
| 15 | |||
| 16 | /** |
||
| 17 | * @var mixed|null |
||
| 18 | */ |
||
| 19 | private $value; |
||
| 20 | |||
| 21 | /** |
||
| 22 | * @var bool |
||
| 23 | */ |
||
| 24 | private $hit; |
||
| 25 | |||
| 26 | /** |
||
| 27 | * @var \DateTimeInterface |
||
| 28 | */ |
||
| 29 | private $expires; |
||
| 30 | |||
| 31 | /** |
||
| 32 | * @param string $key |
||
| 33 | * @param mixed $value |
||
| 34 | * @param bool $hit |
||
| 35 | */ |
||
| 36 | 70 | public function __construct($key, $value = null, $hit = false) |
|
| 42 | |||
| 43 | /** |
||
| 44 | * {@inheritdoc} |
||
| 45 | */ |
||
| 46 | 42 | public function getKey() |
|
| 50 | |||
| 51 | /** |
||
| 52 | * {@inheritdoc} |
||
| 53 | */ |
||
| 54 | 43 | public function get() |
|
| 58 | |||
| 59 | /** |
||
| 60 | * {@inheritdoc} |
||
| 61 | */ |
||
| 62 | 28 | public function isHit() |
|
| 66 | |||
| 67 | /** |
||
| 68 | * {@inheritdoc} |
||
| 69 | */ |
||
| 70 | 42 | public function set($value) |
|
| 76 | |||
| 77 | /** |
||
| 78 | * {@inheritdoc} |
||
| 79 | */ |
||
| 80 | 19 | public function expiresAt($expires) |
|
| 92 | |||
| 93 | /** |
||
| 94 | * {@inheritdoc} |
||
| 95 | */ |
||
| 96 | 7 | public function expiresAfter($time) |
|
| 114 | |||
| 115 | /** |
||
| 116 | * @return \DateTimeInterface |
||
| 117 | */ |
||
| 118 | 45 | public function getExpiresAt() |
|
| 122 | } |
||
| 123 |