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

AuthenticationException   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 50%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
c 2
b 0
f 0
dl 0
loc 12
ccs 2
cts 4
cp 0.5
rs 10
wmc 2
lcom 0
cbo 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A fromCredentials() 0 4 1
A expiredJWT() 0 4 1
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