Passed
Pull Request — master (#182)
by Arman
12:44 queued 09:39
created

AuthException::incorrectAuthService()   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
use Quantum\Exceptions\LangException;
18
19
/**
20
 * Class AuthException
21
 * @package Quantum\Exceptions
22
 */
23
class AuthException extends \Exception
24
{
25
    /**
26
     * @return AuthException
27
     * @throws LangException
28
     */
29
    public static function incorrectCredentials(): AuthException
30
    {
31
        return new static(t('exception.incorrect_auth_credentials'));
32
    }
33
34
    /**
35
     * @return AuthException
36
     * @throws LangException
37
     */
38
    public static function inactiveAccount(): AuthException
39
    {
40
        return new static(t('exception.inactive_account'));
41
    }
42
43
    /**
44
     * @return AuthException
45
     * @throws LangException
46
     */
47
    public static function incorrectVerificationCode(): AuthException
48
    {
49
        return new static(t('exception.incorrect_verification_code'));
50
    }
51
52
    /**
53
     * @return AuthException
54
     * @throws LangException
55
     */
56
    public static function verificationCodeExpired(): AuthException
57
    {
58
        return new static(t('exception.verification_code_expired'));
59
    }
60
61
    /**
62
     * @return AuthException
63
     * @throws LangException
64
     */
65
    public static function misconfiguredAuthConfig(): AuthException
66
    {
67
        return new static(t('exception.misconfigured_auth_config'));
68
    }
69
70
    /**
71
     * @param string $name
72
     * @return AuthException
73
     * @throws LangException
74
     */
75
    public static function undefinedAuthType(string $name): AuthException
0 ignored issues
show
Unused Code introduced by
The parameter $name is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

75
    public static function undefinedAuthType(/** @scrutinizer ignore-unused */ string $name): AuthException

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
76
    {
77
        return new static(t('exception.undefined_auth_type', ''));
78
    }
79
80
    /**
81
     * @return AuthException
82
     * @throws LangException
83
     */
84
    public static function incorrectUserSchema(): AuthException
85
    {
86
        return new static(t('exception.incorrect_user_schema'));
87
    }
88
89
    /**
90
     * @return AuthException
91
     * @throws LangException
92
     */
93
    public static function incorrectAuthService(): AuthException
94
    {
95
        return new static(t('exception.incorrect_auth_service'));
96
    }
97
}
98