Passed
Push — master ( 25a926...39145a )
by
unknown
20:30
created

MfaProvidersProvider::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 1
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * This file is part of the TYPO3 CMS project.
7
 *
8
 * It is free software; you can redistribute it and/or modify it under
9
 * the terms of the GNU General Public License, either version 2
10
 * of the License, or any later version.
11
 *
12
 * For the full copyright and license information, please read the
13
 * LICENSE.txt file that was distributed with this source code.
14
 *
15
 * The TYPO3 project - inspiring people to share!
16
 */
17
18
namespace TYPO3\CMS\Lowlevel\ConfigurationModuleProvider;
19
20
use TYPO3\CMS\Core\Authentication\Mfa\MfaProviderRegistry;
21
22
class MfaProvidersProvider extends AbstractProvider
23
{
24
    protected MfaProviderRegistry $mfaProviderRegistry;
25
26
    public function __construct(MfaProviderRegistry $mfaProviderRegistry)
27
    {
28
        $this->mfaProviderRegistry = $mfaProviderRegistry;
29
    }
30
31
    public function getConfiguration(): array
32
    {
33
        $providers = $this->mfaProviderRegistry->getProviders();
34
        $configuration = [];
35
        foreach ($providers as $identifier => $provider) {
36
            $configuration[$identifier] = [
37
                'title' => $this->getLanguageService()->sL($provider->getTitle()),
38
                'description' => $this->getLanguageService()->sL($provider->getDescription()),
39
                'isDefaultAllowed' => $provider->isDefaultProviderAllowed()
40
            ];
41
        }
42
        return $configuration;
43
    }
44
}
45