Passed
Pull Request — master (#778)
by
unknown
08:24
created

AdminSettings   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 4
eloc 5
c 1
b 0
f 0
dl 0
loc 19
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getSection() 0 2 1
A getForm() 0 4 1
A getPriority() 0 2 1
1
<?php
2
3
declare(strict_types=1);
4
5
/**
6
 * SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors
7
 * SPDX-License-Identifier: AGPL-3.0-or-later
8
 */
9
10
namespace OCA\TwoFactorGateway\Settings\Admin;
11
12
use OCP\AppFramework\Http\TemplateResponse;
13
use OCP\AppFramework\Services\IInitialState;
14
use OCP\IAppConfig;
15
use OCP\Settings\ISettings;
16
use OCP\Util;
17
18
class AdminSettings implements ISettings {
19
	public function __construct(
20
		private IAppConfig $appConfig,
21
		private IInitialState $initialState,
22
	) {
23
	}
24
25
	public function getForm(): TemplateResponse {
26
		Util::addScript('twofactor_gateway', 'whatsapp-settings-simple');
27
28
		return new TemplateResponse('twofactor_gateway', 'admin_whatsapp_settings');
29
	}
30
31
	public function getSection(): string {
32
		return 'twofactor_gateway';
33
	}
34
35
	public function getPriority(): int {
36
		return 10;
37
	}
38
}
39