feat: add default arg to Configuration::getConfig (#3331)

This commit is contained in:
Dag 2023-07-05 05:33:22 +02:00 committed by GitHub
parent cf920694d5
commit a21d496bc7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View file

@ -220,9 +220,9 @@ final class Configuration
}
}
public static function getConfig(string $section, string $key)
public static function getConfig(string $section, string $key, $default = null)
{
return self::$config[strtolower($section)][strtolower($key)] ?? null;
return self::$config[strtolower($section)][strtolower($key)] ?? $default;
}
private static function setConfig(string $section, string $key, $value): void