Completed
Push — master ( 8e3fe7...23d229 )
by Matthew
02:24
created

UnauthorizedException::noToken()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 8
ccs 5
cts 5
cp 1
rs 9.4285
cc 1
eloc 5
nc 1
nop 1
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