Total Lines | 45 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
30 | 1 | interface IStorage |
|
31 | { |
||
32 | /** |
||
33 | * Define session keys |
||
34 | */ |
||
35 | const KEY_MESSAGES = 'messages'; |
||
36 | const KEY_IMPORTANT = 'important'; |
||
37 | |||
38 | /** |
||
39 | * Stores the given ($key, $value) pair, so that future calls to |
||
40 | * get($key) return $value. This call may be in another request. |
||
41 | * |
||
42 | * @param string $key |
||
43 | * @param mixed $value |
||
44 | * |
||
45 | * @return void |
||
46 | */ |
||
47 | function set(string $key, $value); |
||
48 | |||
49 | /** |
||
50 | * Get the data for $key |
||
51 | * |
||
52 | * @param string $key The key of the data to retrieve |
||
53 | * @param mixed $default The default value to return if $key is not found |
||
54 | * |
||
55 | * @return mixed |
||
56 | */ |
||
57 | function get(string $key, $default = FALSE); |
||
58 | |||
59 | /** |
||
60 | * Clear the data with $key from the persistent storage |
||
61 | * |
||
62 | * @param string $key |
||
63 | * |
||
64 | * @return void |
||
65 | */ |
||
66 | function clear(string $key); |
||
67 | |||
68 | /** |
||
69 | * Clear all data from the persistent storage |
||
70 | * |
||
71 | * @return void |
||
72 | */ |
||
73 | function clearAll(); |
||
74 | } |
||
75 |