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

MfaRequiredException   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 5
c 1
b 0
f 0
dl 0
loc 13
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getProvider() 0 3 1
A __construct() 0 4 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\Core\Authentication\Mfa;
19
20
use TYPO3\CMS\Core\Exception;
21
22
/**
23
 * This exception is thrown during the authentication process
24
 * when a user has successfully passed its first authentication
25
 * method (e.g. via username+password), but is required to also
26
 * pass multi-factor authentication (e.g. one-time password).
27
 */
28
class MfaRequiredException extends Exception
29
{
30
    private MfaProviderManifestInterface $provider;
31
32
    public function __construct(MfaProviderManifestInterface $provider, $code = 0, $message = '', \Throwable $previous = null)
33
    {
34
        $this->provider = $provider;
35
        parent::__construct($message, $code, $previous);
36
    }
37
38
    public function getProvider(): MfaProviderManifestInterface
39
    {
40
        return $this->provider;
41
    }
42
}
43