Browse Source

fix psalm

Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
tags/v29.0.0beta1
Maxence Lange 4 months ago
parent
commit
51fa22dc26

+ 2
- 1
lib/private/AppFramework/DependencyInjection/DIContainer.php View File

$this->registerService(IAppConfig::class, function (ContainerInterface $c) { $this->registerService(IAppConfig::class, function (ContainerInterface $c) {
return new OC\AppFramework\Services\AppConfig( return new OC\AppFramework\Services\AppConfig(
$c->get(IConfig::class), $c->get(IConfig::class),
$c->get('AppName')
$c->get('AppName'),
$c->get(\OCP\IAppConfig::class)
); );
}); });
$this->registerService(IInitialState::class, function (ContainerInterface $c) { $this->registerService(IInitialState::class, function (ContainerInterface $c) {

+ 8
- 4
lib/private/AppFramework/Services/AppConfig.php View File

public function __construct( public function __construct(
private IConfig $config, private IConfig $config,
private string $appName, private string $appName,
/** @var \OC\AppConfig */
private \OCP\IAppConfig $appConfig, private \OCP\IAppConfig $appConfig,
) { ) {
} }
* @since 29.0.0 * @since 29.0.0
*/ */
public function hasAppKey(string $key, ?bool $lazy = false): bool { public function hasAppKey(string $key, ?bool $lazy = false): bool {
return $this->appConfig->hasKey($this->appName, $key);
return $this->appConfig->hasKey($this->appName, $key, $lazy);
} }


/** /**
* @since 29.0.0 * @since 29.0.0
*/ */
public function isSensitive(string $key, ?bool $lazy = false): bool { public function isSensitive(string $key, ?bool $lazy = false): bool {
return $this->appConfig->isSensitive($this->appName, $key);
return $this->appConfig->isSensitive($this->appName, $key, $lazy);
} }


/** /**
* @param string $key the key of the value, under which will be saved * @param string $key the key of the value, under which will be saved
* @param string $value the value that should be stored * @param string $value the value that should be stored
* @since 20.0.0 * @since 20.0.0
* @deprecated use {@see setAppValueString()}
* @deprecated 29.0.0 use {@see setAppValueString()}
*/ */
public function setAppValue(string $key, string $value): void { public function setAppValue(string $key, string $value): void {
/** @psalm-suppress InternalMethod */
$this->appConfig->setValueMixed($this->appName, $key, $value); $this->appConfig->setValueMixed($this->appName, $key, $value);
} }


* @param string $default * @param string $default
* *
* @since 20.0.0 * @since 20.0.0
* @deprecated use {@see getAppValueString()}
* @deprecated 29.0.0 use {@see getAppValueString()}
* @return string * @return string
*/ */
public function getAppValue(string $key, string $default = ''): string { public function getAppValue(string $key, string $default = ''): string {
/** @psalm-suppress InternalMethod */
/** @psalm-suppress UndefinedInterfaceMethod */
return $this->appConfig->getValueMixed($this->appName, $key, $default); return $this->appConfig->getValueMixed($this->appName, $key, $default);
} }



+ 2
- 2
lib/public/AppFramework/Services/IAppConfig.php View File

* @param string $value the value that should be stored * @param string $value the value that should be stored
* @return void * @return void
* @since 20.0.0 * @since 20.0.0
* @deprecated use {@see setAppValueString()}
* @deprecated 29.0.0 use {@see setAppValueString()}
*/ */
public function setAppValue(string $key, string $value): void; public function setAppValue(string $key, string $value): void;


* *
* @return string the saved value * @return string the saved value
* @since 20.0.0 * @since 20.0.0
* @deprecated use {@see getAppValueString()}
* @deprecated 29.0.0 use {@see getAppValueString()}
*/ */
public function getAppValue(string $key, string $default = ''): string; public function getAppValue(string $key, string $default = ''): string;



Loading…
Cancel
Save