aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMaxence Lange <maxence@artificial-owl.com>2024-01-31 10:40:46 -0100
committerMaxence Lange <maxence@artificial-owl.com>2024-01-31 21:13:32 -0100
commit51fa22dc26a9200c80202e92d49873a0c8ead455 (patch)
tree0906264438636e0015fd0a111c4383220938472c
parent86835ee899f15ac5fb1d723de18f8764b2a34c2a (diff)
downloadnextcloud-server-51fa22dc26a9200c80202e92d49873a0c8ead455.tar.gz
nextcloud-server-51fa22dc26a9200c80202e92d49873a0c8ead455.zip
fix psalm
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
-rw-r--r--lib/private/AppFramework/DependencyInjection/DIContainer.php3
-rw-r--r--lib/private/AppFramework/Services/AppConfig.php12
-rw-r--r--lib/public/AppFramework/Services/IAppConfig.php4
3 files changed, 12 insertions, 7 deletions
diff --git a/lib/private/AppFramework/DependencyInjection/DIContainer.php b/lib/private/AppFramework/DependencyInjection/DIContainer.php
index c342ea236e2..75eb7890ee2 100644
--- a/lib/private/AppFramework/DependencyInjection/DIContainer.php
+++ b/lib/private/AppFramework/DependencyInjection/DIContainer.php
@@ -345,7 +345,8 @@ class DIContainer extends SimpleContainer implements IAppContainer {
$this->registerService(IAppConfig::class, function (ContainerInterface $c) {
return new OC\AppFramework\Services\AppConfig(
$c->get(IConfig::class),
- $c->get('AppName')
+ $c->get('AppName'),
+ $c->get(\OCP\IAppConfig::class)
);
});
$this->registerService(IInitialState::class, function (ContainerInterface $c) {
diff --git a/lib/private/AppFramework/Services/AppConfig.php b/lib/private/AppFramework/Services/AppConfig.php
index 054ce5f145f..a90e38f065f 100644
--- a/lib/private/AppFramework/Services/AppConfig.php
+++ b/lib/private/AppFramework/Services/AppConfig.php
@@ -37,6 +37,7 @@ class AppConfig implements IAppConfig {
public function __construct(
private IConfig $config,
private string $appName,
+ /** @var \OC\AppConfig */
private \OCP\IAppConfig $appConfig,
) {
}
@@ -61,7 +62,7 @@ class AppConfig implements IAppConfig {
* @since 29.0.0
*/
public function hasAppKey(string $key, ?bool $lazy = false): bool {
- return $this->appConfig->hasKey($this->appName, $key);
+ return $this->appConfig->hasKey($this->appName, $key, $lazy);
}
/**
@@ -73,7 +74,7 @@ class AppConfig implements IAppConfig {
* @since 29.0.0
*/
public function isSensitive(string $key, ?bool $lazy = false): bool {
- return $this->appConfig->isSensitive($this->appName, $key);
+ return $this->appConfig->isSensitive($this->appName, $key, $lazy);
}
/**
@@ -109,9 +110,10 @@ class AppConfig implements IAppConfig {
* @param string $key the key of the value, under which will be saved
* @param string $value the value that should be stored
* @since 20.0.0
- * @deprecated use {@see setAppValueString()}
+ * @deprecated 29.0.0 use {@see setAppValueString()}
*/
public function setAppValue(string $key, string $value): void {
+ /** @psalm-suppress InternalMethod */
$this->appConfig->setValueMixed($this->appName, $key, $value);
}
@@ -229,10 +231,12 @@ class AppConfig implements IAppConfig {
* @param string $default
*
* @since 20.0.0
- * @deprecated use {@see getAppValueString()}
+ * @deprecated 29.0.0 use {@see getAppValueString()}
* @return string
*/
public function getAppValue(string $key, string $default = ''): string {
+ /** @psalm-suppress InternalMethod */
+ /** @psalm-suppress UndefinedInterfaceMethod */
return $this->appConfig->getValueMixed($this->appName, $key, $default);
}
diff --git a/lib/public/AppFramework/Services/IAppConfig.php b/lib/public/AppFramework/Services/IAppConfig.php
index 48c54d80531..9340fdd3c32 100644
--- a/lib/public/AppFramework/Services/IAppConfig.php
+++ b/lib/public/AppFramework/Services/IAppConfig.php
@@ -100,7 +100,7 @@ interface IAppConfig {
* @param string $value the value that should be stored
* @return void
* @since 20.0.0
- * @deprecated use {@see setAppValueString()}
+ * @deprecated 29.0.0 use {@see setAppValueString()}
*/
public function setAppValue(string $key, string $value): void;
@@ -211,7 +211,7 @@ interface IAppConfig {
*
* @return string the saved value
* @since 20.0.0
- * @deprecated use {@see getAppValueString()}
+ * @deprecated 29.0.0 use {@see getAppValueString()}
*/
public function getAppValue(string $key, string $default = ''): string;