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