Code Duplication    Length = 24-24 lines in 2 locations

src/Exception/InvalidToken.php 1 location

@@ 10-33 (lines=24) @@
7
/**
8
 * @author Kevin Bond <[email protected]>
9
 */
10
abstract class InvalidToken extends \DomainException implements Exception
11
{
12
    private $token;
13
14
    /**
15
     * @param Token           $token
16
     * @param string          $message
17
     * @param \Exception|null $previous
18
     */
19
    public function __construct(Token $token, $message = 'Invalid token.', \Exception $previous = null)
20
    {
21
        $this->token = $token;
22
23
        parent::__construct($message, 0, $previous);
24
    }
25
26
    /**
27
     * @return Token
28
     */
29
    final public function token()
30
    {
31
        return $this->token;
32
    }
33
}
34

src/Exception/MalformedToken.php 1 location

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