Completed
Push — master ( 8e3fe7...23d229 )
by Matthew
02:24
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
use Exception;
5
6
/**
7
 * Exception that occurs when a user does not provide authentication
8
 * credentials.
9
 */
10
class UnauthorizedException extends AuthException
11
{
12
    const CODE = 401;
13
14 2
    public static function noToken(Exception $previous = null)
15
    {
16 2
        return new static(
17 2
            'No authentication token was specified',
18 2
            static::CODE,
19
            $previous
20 2
        );
21
    }
22
}
23