Passed
Pull Request — master (#182)
by Arman
06:43 queued 02:40
created

AuthException::inactiveAccount()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
/**
4
 * Quantum PHP Framework
5
 *
6
 * An open source software development framework for PHP
7
 *
8
 * @package Quantum
9
 * @author Arman Ag. <[email protected]>
10
 * @copyright Copyright (c) 2018 Softberg LLC (https://softberg.org)
11
 * @link http://quantum.softberg.org/
12
 * @since 2.9.5
13
 */
14
15
namespace Quantum\Libraries\Auth;
16
17
/**
18
 * Class AuthException
19
 * @package Quantum\Exceptions
20
 */
21
class AuthException extends \Exception
22
{
23
    /**
24
     * @return AuthException
25
     */
26
    public static function incorrectCredentials(): AuthException
27
    {
28
        return new static(t('exception.incorrect_auth_credentials'));
29
    }
30
31
    /**
32
     * @return AuthException
33
     */
34
    public static function inactiveAccount(): AuthException
35
    {
36
        return new static(t('exception.inactive_account'));
37
    }
38
39
    /**
40
     * @return AuthException
41
     */
42
    public static function incorrectVerificationCode(): AuthException
43
    {
44
        return new static(t('exception.incorrect_verification_code'));
45
    }
46
47
    /**
48
     * @return AuthException
49
     */
50
    public static function verificationCodeExpired(): AuthException
51
    {
52
        return new static(t('exception.verification_code_expired'));
53
    }
54
55
    /**
56
     * @return AuthException
57
     */
58
    public static function misconfiguredAuthConfig(): AuthException
59
    {
60
        return new static(t('exception.misconfigured_auth_config'));
61
    }
62
63
    /**
64
     * @param string $name
65
     * @return AuthException
66
     */
67
    public static function undefinedAuthType(string $name): AuthException
68
    {
69
        return new static(t('exception.undefined_auth_type', $name));
70
    }
71
72
    /**
73
     * @return AuthException
74
     */
75
    public static function incorrectUserSchema(): AuthException
76
    {
77
        return new static(t('exception.incorrect_user_schema'));
78
    }
79
80
    /**
81
     * @return AuthException
82
     */
83
    public static function incorrectAuthService(): AuthException
84
    {
85
        return new static(t('exception.incorrect_auth_service'));
86
    }
87
}
88