Completed
Push — master ( e15c58...b150a8 )
by Changwan
07:08
created

UnknownTokenFromLexException::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 1
dl 0
loc 5
ccs 0
cts 5
cp 0
crap 2
rs 9.4285
c 0
b 0
f 0
1
<?php
2
namespace Wandu\Compiler\Exception;
3
4
use RuntimeException;
5
6
class UnknownTokenFromLexException extends RuntimeException
7
{
8
    /** @var string */
9
    protected $token;
10
11
    public function __construct($token)
12
    {
13
        $this->token = $token;
14
        $this->message = "unknown token \"{$token}\".";
15
    }
16
17
    /**
18
     * @return string
19
     */
20
    public function getToken()
21
    {
22
        return $this->token;
23
    }
24
}
25