Completed
Pull Request — master (#4)
by Matthew
03:28
created

UnauthorizedException::getStatusCode()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
namespace Equip\Auth\Exception;
3
4
/**
5
 * Exception that occurs when a user does not provide authentication
6
 * credentials.
7
 */
8
class UnauthorizedException extends AuthException
9
{
10 3
    public function __construct(
11
        $message = 'Unknown authentication error occurred',
12
        $code = 401,
13
        \Exception $previous = null
14
    ) {
15 3
        parent::__construct($message, $code, $previous);
16 3
    }
17
18 1
    public static function noToken()
19
    {
20 1
        throw new static('No authentication token was specified');
21
    }
22
}
23