diff --git a/composer.lock b/composer.lock index f4a0ce1211e..2eaf87fc149 100644 --- a/composer.lock +++ b/composer.lock @@ -183,12 +183,12 @@ "source": { "type": "git", "url": "https://github.com/nextcloud-deps/ocp.git", - "reference": "ef30cb8584a788bf01916ab00c39303e5f58f260" + "reference": "8db67a98bfa9338dfef1f45cd743c98f0f8ab143" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nextcloud-deps/ocp/zipball/ef30cb8584a788bf01916ab00c39303e5f58f260", - "reference": "ef30cb8584a788bf01916ab00c39303e5f58f260", + "url": "https://api.github.com/repos/nextcloud-deps/ocp/zipball/8db67a98bfa9338dfef1f45cd743c98f0f8ab143", + "reference": "8db67a98bfa9338dfef1f45cd743c98f0f8ab143", "shasum": "" }, "require": { @@ -220,7 +220,7 @@ "issues": "https://github.com/nextcloud-deps/ocp/issues", "source": "https://github.com/nextcloud-deps/ocp/tree/master" }, - "time": "2024-01-12T00:34:25+00:00" + "time": "2024-01-16T09:41:42+00:00" }, { "name": "nikic/php-parser", 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 {