1 | <?php |
||
10 | class Config implements JsonSerializable |
||
11 | { |
||
12 | private $items; |
||
13 | |||
14 | 3 | public function __construct(array $items) |
|
18 | |||
19 | /** |
||
20 | * Get option. |
||
21 | * |
||
22 | * @param string $key |
||
23 | * @param null $default |
||
24 | * |
||
25 | * @return mixed |
||
26 | */ |
||
27 | 3 | public function get(string $key, $default = null) |
|
31 | |||
32 | /** |
||
33 | * Set option. |
||
34 | * |
||
35 | * @param string $key |
||
36 | * @param mixed $value |
||
37 | */ |
||
38 | 1 | public function set(string $key, $value): void |
|
42 | |||
43 | /** |
||
44 | * Determine if option exists. |
||
45 | * |
||
46 | * @param string $key |
||
47 | * |
||
48 | * @return bool |
||
49 | */ |
||
50 | 1 | public function has(string $key): bool |
|
54 | |||
55 | /** |
||
56 | * Specify data which should be serialized to JSON. |
||
57 | * @link http://php.net/manual/en/jsonserializable.jsonserialize.php |
||
58 | * @return mixed data which can be serialized by <b>json_encode</b>, |
||
59 | * which is a value of any type other than a resource. |
||
60 | * @since 5.4.0 |
||
61 | */ |
||
62 | 1 | public function jsonSerialize(): array |
|
66 | } |
||
67 |