Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix psalm
Signed-off-by: Maxence Lange <[email protected]>
  • Loading branch information
ArtificialOwl committed Jan 31, 2024
commit 51fa22dc26a9200c80202e92d49873a0c8ead455
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,8 @@ public function __construct(string $appName, array $urlParams = [], ServerContai
$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) {
Expand Down
12 changes: 8 additions & 4 deletions lib/private/AppFramework/Services/AppConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ class AppConfig implements IAppConfig {
public function __construct(
private IConfig $config,
private string $appName,
/** @var \OC\AppConfig */
private \OCP\IAppConfig $appConfig,
) {
}
Expand All @@ -61,7 +62,7 @@ public function getAppKeys(): array {
* @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);
}

/**
Expand All @@ -73,7 +74,7 @@ public function hasAppKey(string $key, ?bool $lazy = false): bool {
* @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);
}

/**
Expand Down Expand Up @@ -109,9 +110,10 @@ public function getAllAppValues(string $key = '', bool $filtered = false): array
* @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);
}

Expand Down Expand Up @@ -229,10 +231,12 @@ public function setAppValueArray(
* @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);
}

Expand Down
4 changes: 2 additions & 2 deletions lib/public/AppFramework/Services/IAppConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public function getAllAppValues(string $key = '', bool $filtered = false): array
* @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;

Expand Down Expand Up @@ -211,7 +211,7 @@ public function setAppValueArray(string $key, array $value, bool $lazy = false,
*
* @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;

Expand Down