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

MalformedToken::__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
/**
6
 * @author Kevin Bond <[email protected]>
7
 */
8 View Code Duplication
final class MalformedToken extends \InvalidArgumentException 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...
9
{
10
    private $token;
11
12
    /**
13
     * @param mixed           $token
14
     * @param string          $message
15
     * @param \Exception|null $previous
16
     */
17 6
    public function __construct($token, $message = 'Malformed token.', \Exception $previous = null)
18
    {
19 6
        $this->token = $token;
20
21 6
        parent::__construct($message, 0, $previous);
22 6
    }
23
24
    /**
25
     * @return mixed
26
     */
27 1
    public function token()
28
    {
29 1
        return $this->token;
30
    }
31
}
32