PersonalSettings   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 6
dl 0
loc 14
ccs 0
cts 7
cp 0
rs 10
c 1
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getBody() 0 6 1
A __construct() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
/**
6
 * SPDX-FileCopyrightText: 2024 Christoph Wurst <[email protected]>
7
 * SPDX-License-Identifier: AGPL-3.0-or-later
8
 */
9
10
namespace OCA\TwoFactorGateway\Settings;
11
12
use OCP\Authentication\TwoFactorAuth\IPersonalProviderSettings;
13
use OCP\Server;
14
use OCP\Template\ITemplate;
15
use OCP\Template\ITemplateManager;
16
17
class PersonalSettings implements IPersonalProviderSettings {
18
19
	public function __construct(
20
		private string $gateway,
21
		private bool $isComplete,
22
	) {
23
	}
24
25
	#[\Override]
26
	public function getBody(): ITemplate {
27
		$template = Server::get(ITemplateManager::class)->getTemplate('twofactor_gateway', 'personal_settings');
28
		$template->assign('gateway', $this->gateway);
29
		$template->assign('isComplete', $this->isComplete);
30
		return $template;
31
	}
32
}
33