aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorMaxence Lange <maxence@artificial-owl.com>2024-01-16 12:48:27 -0100
committerMaxence Lange <maxence@artificial-owl.com>2024-01-16 12:48:27 -0100
commitdb8636ac1a7b208d681465421c8d433a3254c6f3 (patch)
treef60c7f6e9464913dfc3975586350cc69e9ed0575 /lib
parent5f0c406e42ee7e8eb3da4a53e324eb166a968047 (diff)
downloadnextcloud-server-db8636ac1a7b208d681465421c8d433a3254c6f3.tar.gz
nextcloud-server-db8636ac1a7b208d681465421c8d433a3254c6f3.zip
exceptions on their own
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/private/AppConfig.php12
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/private/AppConfig.php b/lib/private/AppConfig.php
index e8192530c17..a6c92351a97 100644
--- a/lib/private/AppConfig.php
+++ b/lib/private/AppConfig.php
@@ -164,7 +164,11 @@ class AppConfig implements IAppConfig {
$this->assertParams($app, $key);
$this->loadConfig($lazy);
- return $this->isTyped(self::VALUE_SENSITIVE, $this->valueTypes[$app][$key] ?? throw new AppConfigUnknownKeyException('unknown config key'));
+ if (!isset($this->valueTypes[$app][$key])) {
+ throw new AppConfigUnknownKeyException('unknown config key');
+ }
+
+ return $this->isTyped(self::VALUE_SENSITIVE, $this->valueTypes[$app][$key]);
}
/**
@@ -955,10 +959,14 @@ class AppConfig implements IAppConfig {
$typeString = (string)$type;
}
+ if (!isset($cache[$app][$key])) {
+ throw new AppConfigUnknownKeyException('unknown config key');
+ }
+
return [
'app' => $app,
'key' => $key,
- 'value' => $cache[$app][$key] ?? throw new AppConfigUnknownKeyException('unknown config key'),
+ 'value' => $cache[$app][$key],
'type' => $type,
'lazy' => $lazy,
'typeString' => $typeString,