Skip to content

Commit 18d6f87

Browse files
committed
chore: Switch app config to boolean values
Signed-off-by: Julius Knorr <[email protected]>
1 parent 9b60bd2 commit 18d6f87

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

lib/ConfigLexicon.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,22 +30,22 @@ public function getAppConfigs(): array {
3030
),
3131
new Entry(
3232
key: 'open_read_only_enabled',
33-
type: ValueType::STRING,
34-
defaultRaw: '0',
33+
type: ValueType::BOOL,
34+
defaultRaw: false,
3535
definition: 'Whether opening files in read-only mode is enabled',
3636
lazy: false,
3737
),
3838
new Entry(
3939
key: 'rich_editing_enabled',
40-
type: ValueType::STRING,
41-
defaultRaw: '1',
40+
type: ValueType::BOOL,
41+
defaultRaw: true,
4242
definition: 'Whether rich editing is enabled',
4343
lazy: false,
4444
),
4545
new Entry(
4646
key: 'workspace_available',
47-
type: ValueType::STRING,
48-
defaultRaw: '1',
47+
type: ValueType::BOOL,
48+
defaultRaw: true,
4949
definition: 'Whether rich workspace feature is available',
5050
lazy: false,
5151
),

lib/Service/ConfigService.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,18 @@ public function getDefaultFileExtension(): string {
2525
}
2626

2727
public function isOpenReadOnlyEnabled(): bool {
28-
return $this->appConfig->getValueString(Application::APP_NAME, 'open_read_only_enabled', '0') === '1';
28+
return $this->appConfig->getValueBool(Application::APP_NAME, 'open_read_only_enabled');
2929
}
3030

3131
public function isRichEditingEnabled(): bool {
32-
return ($this->appConfig->getValueString(Application::APP_NAME, 'rich_editing_enabled', '1') === '1');
32+
return $this->appConfig->getValueBool(Application::APP_NAME, 'rich_editing_enabled', true);
3333
}
3434

3535
public function isRichWorkspaceAvailable(): bool {
3636
if ($this->config->getSystemValueBool('enable_non-accessible_features', true) === false) {
3737
return false;
3838
}
39-
return $this->appConfig->getValueString(Application::APP_NAME, 'workspace_available', '1') === '1';
39+
return $this->appConfig->getValueBool(Application::APP_NAME, 'workspace_available', true);
4040
}
4141

4242
public function isRichWorkspaceEnabledForUser(?string $userId): bool {

0 commit comments

Comments
 (0)