1 | <?php declare(strict_types=1); |
||
13 | class Config implements \ArrayAccess |
||
14 | { |
||
15 | /** |
||
16 | * @var array |
||
17 | */ |
||
18 | protected $data; |
||
19 | |||
20 | 33 | public function __construct(array $data = []) |
|
24 | |||
25 | 30 | public function has(string $key): bool |
|
33 | |||
34 | /** |
||
35 | * Get the specified configuration value. |
||
36 | * |
||
37 | * @param string $key |
||
38 | * @param mixed $default |
||
39 | * @return mixed |
||
40 | */ |
||
41 | 26 | public function get(string $key, $default = null) |
|
49 | |||
50 | /** |
||
51 | * Get the specified required configuration value. |
||
52 | * Will throw an exception if not set. |
||
53 | * |
||
54 | * @param string $key |
||
55 | * @return mixed |
||
56 | */ |
||
57 | 2 | public function getRequired(string $key) |
|
65 | |||
66 | 1 | public function all(): array |
|
70 | |||
71 | /** |
||
72 | * Determine if the given configuration option exists. |
||
73 | * |
||
74 | * @param string $key |
||
75 | * @return bool |
||
76 | */ |
||
77 | 1 | public function offsetExists($key): bool |
|
81 | |||
82 | /** |
||
83 | * Get a configuration option. |
||
84 | * |
||
85 | * @param string $key |
||
86 | * @return mixed |
||
87 | */ |
||
88 | 1 | public function offsetGet($key) |
|
92 | |||
93 | /** |
||
94 | * Set a configuration option. |
||
95 | * |
||
96 | * @param string $key |
||
97 | * @param mixed $value |
||
98 | * @throws \LogicException |
||
99 | */ |
||
100 | 1 | public function offsetSet($key, $value): void |
|
104 | |||
105 | /** |
||
106 | * Unset a configuration option. |
||
107 | * |
||
108 | * @param string $key |
||
109 | * @throws \LogicException |
||
110 | */ |
||
111 | 1 | public function offsetUnset($key): void |
|
115 | } |
||
116 |