Passed
Pull Request — master (#182)
by Arman
05:01 queued 02:11
created

CsrfException   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 3
dl 0
loc 16
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A tokenNotFound() 0 3 1
A tokenNotMatched() 0 3 1
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\Csrf;
16
17
use Quantum\Exceptions\AppException;
18
19
/**
20
 * Class CsrfException
21
 * @package Quantum\Libraries\Csrf
22
 */
23
class CsrfException extends AppException
24
{
25
    /**
26
     * @return CsrfException
27
     */
28
    public static function tokenNotFound(): CsrfException
29
    {
30
        return new static(t('exception.csrf_token_not_found'), E_WARNING);
31
    }
32
33
    /**
34
     * @return CsrfException
35
     */
36
    public static function tokenNotMatched(): CsrfException
37
    {
38
        return new static(t('exception.csrf_token_not_matched'), E_WARNING);
39
    }
40
}
41