Application::boot()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

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