/
StorageInterface.php
47 lines (42 loc) · 1023 Bytes
/
StorageInterface.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<?php
namespace HZ\Contracts\Storage;
interface StorageInterface
{
/**
* Set new value to the container
*
* @param string $key
* @param mixed $value
* @return void
*/
public function set(string $key, $value);
/**
* Check if the container has a value for the given key
*
* @param string $key
* @return boolean
*/
public function has(string $key): bool;
/**
* Get a value from the storage container
* If no value exists for the given key, return the default value instead
*
* @param string $key
* @param mixed $default
* @return mixed
*/
public function get(string $key, $default);
/**
* Get all stored values in the container
*
* @return iterable
*/
public function all(): iterable;
/**
* Remove the value from the container
*
* @param string $key
* @return void
*/
public function remove(string $key);
}