| 1 | <?php |
||
| 8 | class IlluminateCacheAdapter implements StorageInterface |
||
| 9 | { |
||
| 10 | /** |
||
| 11 | * @var \Illuminate\Cache\CacheManager |
||
| 12 | */ |
||
| 13 | protected $cache; |
||
| 14 | |||
| 15 | /** |
||
| 16 | * @var string |
||
| 17 | */ |
||
| 18 | protected $tag = 'tymon.jwt'; |
||
| 19 | |||
| 20 | /** |
||
| 21 | * @param \Illuminate\Cache\CacheManager $cache |
||
| 22 | */ |
||
| 23 | 12 | public function __construct(CacheManager $cache) |
|
| 27 | |||
| 28 | /** |
||
| 29 | * Add a new item into storage |
||
| 30 | * |
||
| 31 | * @param string $key |
||
| 32 | * @param mixed $value |
||
| 33 | * @param int $minutes |
||
| 34 | * @return void |
||
| 35 | */ |
||
| 36 | 3 | public function add($key, $value, $minutes) |
|
| 40 | |||
| 41 | /** |
||
| 42 | * Check whether a key exists in storage |
||
| 43 | * |
||
| 44 | * @param string $key |
||
| 45 | * @return bool |
||
| 46 | */ |
||
| 47 | 3 | public function has($key) |
|
| 51 | |||
| 52 | /** |
||
| 53 | * Remove an item from storage |
||
| 54 | * |
||
| 55 | * @param string $key |
||
| 56 | * @return bool |
||
| 57 | */ |
||
| 58 | 3 | public function destroy($key) |
|
| 62 | |||
| 63 | /** |
||
| 64 | * Remove all items associated with the tag |
||
| 65 | * |
||
| 66 | * @return void |
||
| 67 | */ |
||
| 68 | 3 | public function flush() |
|
| 72 | |||
| 73 | /** |
||
| 74 | * Return the cache instance with tags attached |
||
| 75 | * |
||
| 76 | * @return \Illuminate\Cache\CacheManager |
||
| 77 | */ |
||
| 78 | 12 | protected function cache() |
|
| 86 | } |
||
| 87 |