Application   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 4
eloc 9
dl 0
loc 18
ccs 0
cts 8
cp 0
rs 10
c 1
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A register() 0 6 2
A __construct() 0 2 1
A boot() 0 2 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\AppInfo;
11
12
use OCA\TwoFactorGateway\Provider\Factory;
13
use OCP\AppFramework\App;
14
use OCP\AppFramework\Bootstrap\IBootContext;
15
use OCP\AppFramework\Bootstrap\IBootstrap;
16
use OCP\AppFramework\Bootstrap\IRegistrationContext;
17
use OCP\Server;
18
19
class Application extends App implements IBootstrap {
20
	public const APP_ID = 'twofactor_gateway';
21
22
	public function __construct(array $urlParams = []) {
23
		parent::__construct(self::APP_ID, $urlParams);
24
	}
25
26
	#[\Override]
27
	public function register(IRegistrationContext $context): void {
28
		$providerFactory = Server::get(Factory::class);
29
		$fqcn = $providerFactory->getFqcnList();
30
		foreach ($fqcn as $class) {
31
			$context->registerTwoFactorProvider($class);
32
		}
33
	}
34
35
	#[\Override]
36
	public function boot(IBootContext $context): void {
37
	}
38
}
39