2 namespace Consolidation\Config;
4 interface ConfigInterface
7 * Determine if a non-default config value exists.
9 public function has($key);
12 * Fetch a configuration value
14 * @param string $key Which config item to look up
15 * @param string|null $defaultFallback Fallback default value to use when
16 * configuration object has neither a value nor a default. Use is
17 * discouraged; use default context in ConfigOverlay, or provide defaults
18 * using a config processor.
22 public function get($key, $defaultFallback = null);
32 public function set($key, $value);
35 * Import configuration from the provided nexted array, replacing whatever
36 * was here previously. No processing is done on the provided data.
38 * @deprecated Use 'replace'. Dflydev\DotAccessData\Data::import() merges, which is confusing, since this method replaces.
43 public function import($data);
46 * Load configuration from the provided nexted array, replacing whatever
47 * was here previously. No processing is done on the provided data.
49 * TODO: This will become a required method in version 2.0. Adding now
50 * would break clients that implement ConfigInterface.
55 // public function replace($data);
58 * Import configuration from the provided nexted array, merging with whatever
59 * was here previously. No processing is done on the provided data.
60 * Any data provided to the combine() method will overwrite existing data
63 * TODO: This will become a required method in version 2.0. Adding now
64 * would break clients that implement ConfigInterface.
69 // public function combine($data);
72 * Export all configuration as a nested array.
74 public function export();
77 * Return the default value for a given configuration item.
83 public function hasDefault($key);
86 * Return the default value for a given configuration item.
89 * @param mixed $defaultFallback
93 public function getDefault($key, $defaultFallback = null);
96 * Set the default value for a configuration setting. This allows us to
97 * set defaults either before or after more specific configuration values
98 * are loaded. Keeping defaults separate from current settings also
99 * allows us to determine when a setting has been overridden.
102 * @param string $value
104 public function setDefault($key, $value);