TokenNotFoundException::create()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 10

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 10
c 0
b 0
f 0
ccs 6
cts 6
cp 1
rs 9.9332
cc 1
nc 1
nop 2
crap 1
1
<?php
2
3
namespace Yokai\SecurityTokenBundle\Exception;
4
5
/**
6
 * Exception thrown when token is not found.
7
 *
8
 * @author Yann Eugoné <[email protected]>
9
 */
10
class TokenNotFoundException extends InvalidTokenException
11
{
12
    /**
13
     * Create an instance of this class.
14
     *
15
     * @param string $value   The token value
16
     * @param string $purpose The token purpose
17
     *
18
     * @return TokenNotFoundException
19
     */
20 2
    public static function create($value, $purpose)
21
    {
22 2
        return new self(
23 2
            sprintf(
24 2
                'The "%s" token with value "%s" was not found.',
25 2
                $purpose,
26 2
                $value
27
            )
28
        );
29
    }
30
}
31