Completed
Pull Request — master (#1)
by Woody
23:31 queued 01:08
created

InvalidException::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
c 2
b 0
f 0
dl 0
loc 7
rs 9.4286
cc 1
eloc 5
nc 1
nop 3
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