1 | <?php |
||
18 | class ConfigOverlay implements ConfigInterface, ConfigInterpolatorInterface, ConfigRuntimeInterface |
||
19 | { |
||
20 | use ConfigInterpolatorTrait; |
||
21 | protected $contexts = []; |
||
22 | |||
23 | const DEFAULT_CONTEXT = 'default'; |
||
24 | const PROCESS_CONTEXT = 'process'; |
||
25 | |||
26 | public function __construct() |
||
31 | |||
32 | /** |
||
33 | * Add a named configuration object to the configuration overlay. |
||
34 | * Configuration objects added LAST have HIGHEST priority, with the |
||
35 | * exception of the fact that the process context always has the |
||
36 | * highest priority. |
||
37 | * |
||
38 | * If a context has already been added, its priority will not change. |
||
39 | */ |
||
40 | public function addContext($name, ConfigInterface $config) |
||
49 | |||
50 | /** |
||
51 | * Add a placeholder context that will be prioritized higher than |
||
52 | * existing contexts. This is done to ensure that contexts added |
||
53 | * later will maintain a higher priority if the placeholder context |
||
54 | * is later relaced with a different configuration set via addContext(). |
||
55 | * |
||
56 | * @param string $name |
||
57 | * @return $this |
||
58 | */ |
||
59 | public function addPlaceholder($name) |
||
63 | |||
64 | /** |
||
65 | * Increase the priority of the named context such that it is higher |
||
66 | * in priority than any existing context except for the 'process' |
||
67 | * context. |
||
68 | * |
||
69 | * @param string $name |
||
70 | * @return $this |
||
71 | */ |
||
72 | public function increasePriority($name) |
||
78 | |||
79 | public function hasContext($name) |
||
83 | |||
84 | public function getContext($name) |
||
91 | |||
92 | public function runtimeConfig() |
||
96 | |||
97 | public function removeContext($name) |
||
101 | |||
102 | /** |
||
103 | * Determine if a non-default config value exists. |
||
104 | */ |
||
105 | public function findContext($key) |
||
114 | |||
115 | /** |
||
116 | * @inheritdoc |
||
117 | */ |
||
118 | public function has($key) |
||
122 | |||
123 | /** |
||
124 | * @inheritdoc |
||
125 | */ |
||
126 | public function get($key, $default = null) |
||
133 | |||
134 | public function getSingle($key, $default = null) |
||
142 | |||
143 | public function getUnion($key) |
||
154 | |||
155 | /** |
||
156 | * @inheritdoc |
||
157 | */ |
||
158 | public function set($key, $value) |
||
163 | |||
164 | /** |
||
165 | * @inheritdoc |
||
166 | */ |
||
167 | public function import($data) |
||
171 | |||
172 | /** |
||
173 | * @inheritdoc |
||
174 | */ |
||
175 | public function replace($data) |
||
179 | |||
180 | /** |
||
181 | * @inheritdoc |
||
182 | */ |
||
183 | public function combine($data) |
||
187 | |||
188 | /** |
||
189 | * @inheritdoc |
||
190 | */ |
||
191 | protected function unsupported($fn) |
||
195 | |||
196 | /** |
||
197 | * @inheritdoc |
||
198 | */ |
||
199 | public function export() |
||
208 | |||
209 | /** |
||
210 | * @inheritdoc |
||
211 | */ |
||
212 | public function hasDefault($key) |
||
216 | |||
217 | /** |
||
218 | * @inheritdoc |
||
219 | */ |
||
220 | public function getDefault($key, $default = null) |
||
224 | |||
225 | /** |
||
226 | * @inheritdoc |
||
227 | */ |
||
228 | public function setDefault($key, $value) |
||
233 | } |
||
234 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.