mirror of
https://github.com/daledavies/jump.git
synced 2026-02-01 03:59:06 +01:00
Make Config::get() case insensitive
This commit is contained in:
@@ -111,11 +111,12 @@ class Config {
|
||||
* Retrieves the config parameter provided in $key, first checks for its
|
||||
* existence.
|
||||
*
|
||||
* @param string $key The requested config parameter key.
|
||||
* @param string $key The requested config parameter key, not case sensitive.
|
||||
* @param bool $strict Throw exception if requested param is not found, or return null.
|
||||
* @return mixed The selected value from the configuration array.
|
||||
*/
|
||||
public function get(string $key, $strict = true): mixed {
|
||||
$key = strtolower($key);
|
||||
if (!$this->config->has($key) && $strict === true) {
|
||||
throw new ConfigException('Config key does not exist... ('.$key.')');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user