Completed
Push — master ( e214c2...9b8774 )
by Kevin
02:27
created

InvalidToken::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 6
Ratio 100 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 6
loc 6
ccs 4
cts 4
cp 1
rs 9.4286
cc 1
eloc 3
nc 1
nop 3
crap 1
1
<?php
2
3
namespace Zenstruck\JWT\Exception;
4
5
use Zenstruck\JWT\Token;
6
7
/**
8
 * @author Kevin Bond <[email protected]>
9
 */
10 View Code Duplication
abstract class InvalidToken extends \DomainException implements Exception
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
11
{
12
    private $token;
13
14
    /**
15
     * @param Token           $token
16
     * @param string          $message
17
     * @param \Exception|null $previous
18
     */
19 36
    public function __construct(Token $token, $message = 'Invalid token.', \Exception $previous = null)
20
    {
21 36
        $this->token = $token;
22
23 36
        parent::__construct($message, 0, $previous);
24 36
    }
25
26
    /**
27
     * @return Token
28
     */
29 5
    final public function token()
30
    {
31 5
        return $this->token;
32
    }
33
}
34