| 1 | <?php |
||
| 8 | class CacheItem implements CacheItemInterface |
||
| 9 | { |
||
| 10 | /** |
||
| 11 | * @var string |
||
| 12 | */ |
||
| 13 | private $key; |
||
| 14 | |||
| 15 | /** |
||
| 16 | * @var mixed|null |
||
| 17 | */ |
||
| 18 | private $value; |
||
| 19 | |||
| 20 | /** |
||
| 21 | * @var bool |
||
| 22 | */ |
||
| 23 | private $hit; |
||
| 24 | |||
| 25 | /** |
||
| 26 | * @var \DateTimeInterface|\DateInterval|int |
||
| 27 | */ |
||
| 28 | private $expires; |
||
| 29 | |||
| 30 | /** |
||
| 31 | * @param string $key |
||
| 32 | * @param mixed $value |
||
| 33 | * @param bool $hit |
||
| 34 | */ |
||
| 35 | 31 | public function __construct($key, $value = null, $hit = false) |
|
| 41 | |||
| 42 | /** |
||
| 43 | * {@inheritdoc} |
||
| 44 | */ |
||
| 45 | 18 | public function getKey() |
|
| 49 | |||
| 50 | /** |
||
| 51 | * {@inheritdoc} |
||
| 52 | */ |
||
| 53 | 20 | public function get() |
|
| 57 | |||
| 58 | /** |
||
| 59 | * {@inheritdoc} |
||
| 60 | */ |
||
| 61 | 15 | public function isHit() |
|
| 65 | |||
| 66 | /** |
||
| 67 | * {@inheritdoc} |
||
| 68 | */ |
||
| 69 | 9 | public function set($value) |
|
| 75 | |||
| 76 | /** |
||
| 77 | * {@inheritdoc} |
||
| 78 | */ |
||
| 79 | 5 | public function expiresAt($expiration) |
|
| 85 | |||
| 86 | /** |
||
| 87 | * {@inheritdoc} |
||
| 88 | */ |
||
| 89 | 4 | public function expiresAfter($time) |
|
| 95 | |||
| 96 | /** |
||
| 97 | * @return int|null |
||
| 98 | * The amount of minutes this item should stay alive. Or null when no expires is given. |
||
| 99 | */ |
||
| 100 | 21 | public function getTTL() |
|
| 116 | } |
||
| 117 |