Completed
Pull Request — master (#1)
by Woody
16:22
created

InvalidException::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 specifies an authentication token that is
6
 * invalid.
7
 */
8
class InvalidException extends AuthException
9
{
10
    const CODE_TOKEN_EXPIRED = 1;
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 7 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
11
    const CODE_TOKEN_INVALID = 2;
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 7 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
12
    const CODE_CREDENTIALS_INVALID = 3;
13
14 5
    public function __construct(
15
        $message = 'The token being used is invalid',
16
        $code = 0,
17
        \Exception $previous = null
18
    ) {
19 5
        parent::__construct($message, $code, $previous);
20 5
    }
21
22 1
    public function getStatusCode()
23
    {
24 1
        return 403;
25
    }
26
}
27