| 1 | <?php |
||
| 12 | class StashAdapter implements CacheAdapterInterface |
||
| 13 | { |
||
| 14 | /** |
||
| 15 | * @var Pool |
||
| 16 | */ |
||
| 17 | private $pool; |
||
| 18 | /** |
||
| 19 | * @var null |
||
| 20 | */ |
||
| 21 | private $expire; |
||
| 22 | /** |
||
| 23 | * @var SerializerInterface |
||
| 24 | */ |
||
| 25 | private $serializer; |
||
| 26 | |||
| 27 | /** |
||
| 28 | * @param Pool $pool |
||
| 29 | * @param SerializerInterface $serializer |
||
| 30 | * @param null $expire |
||
| 31 | */ |
||
| 32 | 4 | public function __construct(Pool $pool, SerializerInterface $serializer, $expire = null) |
|
| 38 | |||
| 39 | /** |
||
| 40 | * Gets a cache entry |
||
| 41 | * returning null if not in cache |
||
| 42 | * |
||
| 43 | * @param $key |
||
| 44 | * @return null|mixed |
||
| 45 | */ |
||
| 46 | 4 | public function get($key) |
|
| 55 | |||
| 56 | /** |
||
| 57 | * Sets a cache entry |
||
| 58 | * |
||
| 59 | * @param $key |
||
| 60 | * @param $value |
||
| 61 | * @return void |
||
| 62 | */ |
||
| 63 | 3 | public function set($key, $value) |
|
| 68 | |||
| 69 | /** |
||
| 70 | * Deletes a cache entry |
||
| 71 | * |
||
| 72 | * @param $key |
||
| 73 | * @return void |
||
| 74 | */ |
||
| 75 | 1 | public function delete($key) |
|
| 80 | } |
||
| 81 |