1 | <?php |
||
7 | final class ArrayStorageCache implements StorageCacheInterface |
||
8 | { |
||
9 | /** |
||
10 | * @var array |
||
11 | */ |
||
12 | private $cache = []; |
||
13 | |||
14 | /** |
||
15 | * @param array $cache |
||
16 | */ |
||
17 | public function __construct(array $cache = []) |
||
21 | |||
22 | /** |
||
23 | * @param string $id |
||
24 | * @param array $entry |
||
25 | * |
||
26 | * @return StorageCacheInterface |
||
27 | */ |
||
28 | public function set(string $id, array $entry): StorageCacheInterface |
||
34 | |||
35 | /** |
||
36 | * @param string $id |
||
37 | * |
||
38 | * @return bool |
||
39 | */ |
||
40 | public function has(string $id): bool |
||
44 | |||
45 | /** |
||
46 | * @param string $id |
||
47 | * |
||
48 | * @return array |
||
49 | * |
||
50 | * @throws EntryNotFoundException |
||
51 | */ |
||
52 | public function get(string $id) |
||
60 | |||
61 | /** |
||
62 | * @param string $id |
||
63 | * |
||
64 | * @return StorageCacheInterface |
||
65 | */ |
||
66 | public function remove(string $id): StorageCacheInterface |
||
72 | |||
73 | /** |
||
74 | * @return StorageCacheInterface |
||
75 | */ |
||
76 | public function clear(): StorageCacheInterface |
||
82 | } |
||
83 |