Completed
Pull Request — master (#32)
by Yann
03:30
created

Exception/TokenNotFoundException.php (1 issue)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

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
0 ignored issues
show
Should the return type not be \self?

This check compares the return type specified in the @return annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.

Loading history...
19
     */
20 2
    public static function create(string $value, string $purpose): self
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