| 1 | <?php |
||
| 16 | class CacheItem implements CacheItemInterface |
||
| 17 | { |
||
| 18 | /** @var mixed */ |
||
| 19 | private $value; |
||
| 20 | |||
| 21 | /** @var string */ |
||
| 22 | private $key; |
||
| 23 | |||
| 24 | /** @var DateTime */ |
||
| 25 | private $expiration; |
||
| 26 | |||
| 27 | /** @var boolean */ |
||
| 28 | private $hit; |
||
| 29 | |||
| 30 | /** |
||
| 31 | * @param string $key |
||
| 32 | * @param DateTime|integer|null $ttl |
||
| 33 | * @param boolean $hit |
||
| 34 | * @throws InvalidArgumentException |
||
| 35 | */ |
||
| 36 | 18 | public function __construct($key, $ttl = null, $hit = false) |
|
| 42 | |||
| 43 | /** |
||
| 44 | * @inheritdoc |
||
| 45 | */ |
||
| 46 | 2 | public function getKey() |
|
| 50 | |||
| 51 | /** |
||
| 52 | * @inheritdoc |
||
| 53 | */ |
||
| 54 | 1 | public function get() |
|
| 58 | |||
| 59 | /** |
||
| 60 | * @inheritdoc |
||
| 61 | */ |
||
| 62 | 1 | public function set($value) |
|
| 68 | |||
| 69 | /** |
||
| 70 | * @inheritdoc |
||
| 71 | */ |
||
| 72 | 3 | public function isHit() |
|
| 76 | |||
| 77 | /** |
||
| 78 | * @inheritdoc |
||
| 79 | */ |
||
| 80 | 1 | public function exists() |
|
| 84 | |||
| 85 | /** |
||
| 86 | * @inheritdoc |
||
| 87 | */ |
||
| 88 | 8 | public function setExpiration($ttl = null) |
|
| 100 | |||
| 101 | /** |
||
| 102 | * @inheritdoc |
||
| 103 | */ |
||
| 104 | 3 | public function getExpiration() |
|
| 108 | |||
| 109 | /** |
||
| 110 | * @param boolean $hit |
||
| 111 | * |
||
| 112 | * @return CacheItem |
||
| 113 | * @throws InvalidArgumentException not a boolean value given |
||
| 114 | */ |
||
| 115 | 8 | public function setHit($hit) |
|
| 125 | } |
||
| 126 |