PersonalSettings::getBody()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
dl 0
loc 6
ccs 0
cts 5
cp 0
rs 10
c 1
b 0
f 0
cc 1
nc 1
nop 0
crap 2
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