Completed
Push — master ( 9ab4b9...065cdd )
by Alejandro
09:44
created

AuthenticationException::fromCredentials()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 2
dl 0
loc 4
ccs 0
cts 2
cp 0
crap 2
rs 10
1
<?php
2
namespace Shlinkio\Shlink\Rest\Exception;
3
4
use Shlinkio\Shlink\Common\Exception\ExceptionInterface;
5
6
class AuthenticationException extends \RuntimeException implements ExceptionInterface
7
{
8
    public static function fromCredentials($username, $password)
9
    {
10
        return new self(sprintf('Invalid credentials. Username -> "%s". Password -> "%s"', $username, $password));
11
    }
12
13 1
    public static function expiredJWT(\Exception $prev = null)
14
    {
15 1
        return new self('The token has expired.', -1, $prev);
16
    }
17
}
18