Skip to content

Commit 236e15d

Browse files
committed
Fixing whitespaces on PHP files
Signed-off-by: Azri Adam <[email protected]>
1 parent b58a73c commit 236e15d

File tree

3 files changed

+24
-41
lines changed

3 files changed

+24
-41
lines changed

lib/Controller/SettingsController.php

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,18 @@
1414
use OCP\IConfig;
1515
use OCP\IRequest;
1616

17-
class SettingsController extends Controller
18-
{
17+
class SettingsController extends Controller {
1918
public const ACCEPTED_KEYS = [
2019
'workspace_enabled',
2120
'is_full_width_editor'
2221
];
2322

2423
public function __construct(
25-
string $appName,
26-
IRequest $request,
24+
string $appName,
25+
IRequest $request,
2726
private IConfig $config,
2827
private ?string $userId,
29-
)
30-
{
28+
) {
3129
parent::__construct($appName, $request);
3230
}
3331

@@ -37,8 +35,7 @@ public function __construct(
3735
* @psalm-return DataResponse<200|400, array{workspace_enabled?: mixed, is_full_width_editor?: mixed, message?: 'Invalid config key'}, array<never, never>>
3836
*/
3937
#[NoAdminRequired]
40-
public function updateConfig(string $key, int|string $value): DataResponse
41-
{
38+
public function updateConfig(string $key, int|string $value): DataResponse {
4239
if (!in_array($key, self::ACCEPTED_KEYS, true)) {
4340
return new DataResponse(['message' => 'Invalid config key'], Http::STATUS_BAD_REQUEST);
4441
}

lib/Service/ConfigService.php

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -11,49 +11,41 @@
1111
use OCP\IAppConfig;
1212
use OCP\IConfig;
1313

14-
class ConfigService
15-
{
14+
class ConfigService {
1615
public function __construct(
1716
private IAppConfig $appConfig,
18-
private IConfig $config,
19-
)
20-
{
17+
private IConfig $config,
18+
) {
2119
}
2220

23-
public function getDefaultFileExtension(): string
24-
{
21+
public function getDefaultFileExtension(): string {
2522
return $this->appConfig->getValueString(Application::APP_NAME, 'default_file_extension', 'md');
2623
}
2724

28-
public function isRichEditingEnabled(): bool
29-
{
25+
public function isRichEditingEnabled(): bool {
3026
return ($this->appConfig->getValueString(Application::APP_NAME, 'rich_editing_enabled', '1') === '1');
3127
}
3228

33-
public function isRichWorkspaceAvailable(): bool
34-
{
29+
public function isRichWorkspaceAvailable(): bool {
3530
if ($this->config->getSystemValueBool('enable_non-accessible_features', true) === false) {
3631
return false;
3732
}
3833
return $this->appConfig->getValueString(Application::APP_NAME, 'workspace_available', '1') === '1';
3934
}
4035

41-
public function isRichWorkspaceEnabledForUser(?string $userId): bool
42-
{
36+
public function isRichWorkspaceEnabledForUser(?string $userId): bool {
4337
if ($userId === null) {
4438
return true;
4539
}
4640
return $this->config->getUserValue($userId, Application::APP_NAME, 'workspace_enabled', '1') === '1';
4741
}
4842

49-
public function isNotifyPushSyncEnabled(): bool
50-
{
43+
public function isNotifyPushSyncEnabled(): bool {
5144
return $this->appConfig->getValueBool(Application::APP_NAME, 'notify_push');
5245

5346
}
5447

55-
public function isFullWidthEditor(?string $userId): bool
56-
{
48+
public function isFullWidthEditor(?string $userId): bool {
5749
return $this->config->getUserValue($userId, Application::APP_NAME, 'is_full_width_editor', '0') === '1';
5850
}
5951
}

lib/Service/InitialStateProvider.php

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@
1111
use OCP\TaskProcessing\IManager;
1212
use OCP\Translation\ITranslationManager;
1313

14-
class InitialStateProvider
15-
{
14+
class InitialStateProvider {
1615
private const ASSISTANT_TASK_TYPES = [
1716
'core:text2text',
1817
'core:text2text:formalization',
@@ -24,17 +23,15 @@ class InitialStateProvider
2423
];
2524

2625
public function __construct(
27-
private IInitialState $initialState,
28-
private ConfigService $configService,
26+
private IInitialState $initialState,
27+
private ConfigService $configService,
2928
private ITranslationManager $translationManager,
30-
private IManager $taskProcessingManager,
31-
private ?string $userId,
32-
)
33-
{
29+
private IManager $taskProcessingManager,
30+
private ?string $userId,
31+
) {
3432
}
3533

36-
public function provideState(): void
37-
{
34+
public function provideState(): void {
3835
$this->initialState->provideInitialState(
3936
'workspace_available',
4037
$this->configService->isRichWorkspaceAvailable()
@@ -87,18 +84,15 @@ public function provideState(): void
8784
);
8885
}
8986

90-
public function provideFileId(int $fileId): void
91-
{
87+
public function provideFileId(int $fileId): void {
9288
$this->initialState->provideInitialState('file_id', $fileId);
9389
}
9490

95-
public function provideFile(array $fileData): void
96-
{
91+
public function provideFile(array $fileData): void {
9792
$this->initialState->provideInitialState('file', $fileData);
9893
}
9994

100-
public function provideDirectEditToken(string $token): void
101-
{
95+
public function provideDirectEditToken(string $token): void {
10296
$this->initialState->provideInitialState('directEditingToken', $token);
10397
}
10498
}

0 commit comments

Comments
 (0)