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

InvalidException   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 19
ccs 5
cts 5
cp 1
rs 10

2 Methods

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