1 | <?php |
||
11 | class FilesystemCache implements Cache |
||
12 | { |
||
13 | private $filesystem; |
||
14 | |||
15 | 3 | public function __construct(Filesystem $filesystem) |
|
19 | |||
20 | /** |
||
21 | * Retrieve an item from the cache by key. |
||
22 | * |
||
23 | * @param string $key |
||
24 | * @param mixed $default |
||
25 | * |
||
26 | * @return mixed |
||
27 | */ |
||
28 | 1 | public function get(string $key, $default = null) |
|
32 | |||
33 | /** |
||
34 | * Store an item in the cache. |
||
35 | * |
||
36 | * @param string $key |
||
37 | * @param mixed $value |
||
38 | */ |
||
39 | 1 | public function store(string $key, $value): void |
|
50 | |||
51 | /** |
||
52 | * Remove an item from the cache. |
||
53 | * |
||
54 | * @param string $key |
||
55 | */ |
||
56 | 1 | public function forget(string $key): void |
|
60 | |||
61 | 3 | private function key(string $key): string |
|
65 | } |
||
66 |