diff --git a/lib/Migration/ResetSessionsBeforeYjs.php b/lib/Migration/ResetSessionsBeforeYjs.php index a9ad5d451c9..be6fc9f37c7 100644 --- a/lib/Migration/ResetSessionsBeforeYjs.php +++ b/lib/Migration/ResetSessionsBeforeYjs.php @@ -4,16 +4,16 @@ use OCA\Text\Db\SessionMapper; use OCA\Text\Service\DocumentService; -use OCP\IConfig; +use OCP\IAppConfig; use OCP\Migration\IOutput; use OCP\Migration\IRepairStep; class ResetSessionsBeforeYjs implements IRepairStep { - private IConfig $config; + private IAppConfig $config; private SessionMapper $sessionMapper; private DocumentService $documentService; - public function __construct(IConfig $config, + public function __construct(IAppConfig $config, SessionMapper $sessionMapper, DocumentService $documentService) { $this->config = $config; @@ -34,7 +34,7 @@ public function getName(): string { * @return void */ public function run(IOutput $output): void { - $appVersion = $this->config->getAppValue('text', 'installed_version'); + $appVersion = $this->config->getValueString('text', 'installed_version'); if (!$appVersion || version_compare($appVersion, '3.7.2') !== -1) { return; diff --git a/lib/Service/ConfigService.php b/lib/Service/ConfigService.php index 1ab6e65ae7d..3bb7b27e0b7 100644 --- a/lib/Service/ConfigService.php +++ b/lib/Service/ConfigService.php @@ -3,25 +3,26 @@ namespace OCA\Text\Service; use OCA\Text\AppInfo\Application; +use OCP\IAppConfig; use OCP\IConfig; class ConfigService { - private IConfig $config; - - public function __construct(IConfig $config) { - $this->config = $config; + public function __construct( + private IAppConfig $appConfig, + private IConfig $config, + ) { } public function getDefaultFileExtension(): string { - return $this->config->getAppValue(Application::APP_NAME, 'default_file_extension', 'md'); + return $this->appConfig->getValueString(Application::APP_NAME, 'default_file_extension', 'md'); } public function isRichEditingEnabled(): bool { - return ($this->config->getAppValue(Application::APP_NAME, 'rich_editing_enabled', '1') === '1'); + return ($this->appConfig->getValueString(Application::APP_NAME, 'rich_editing_enabled', '1') === '1'); } public function isRichWorkspaceAvailable(): bool { - return $this->config->getAppValue(Application::APP_NAME, 'workspace_available', '1') === '1'; + return $this->appConfig->getValueString(Application::APP_NAME, 'workspace_available', '1') === '1'; } public function isRichWorkspaceEnabledForUser(?string $userId): bool {