Total Complexity | 3 |
Total Lines | 24 |
Duplicated Lines | 0 % |
Coverage | 0% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
7 | class SyntaxException extends \ErrorException |
||
8 | { |
||
9 | /** @readonly */ |
||
10 | public ?int $position; |
||
11 | |||
12 | public function __construct(string $msg, ?int $position) |
||
13 | { |
||
14 | $this->position = $position; |
||
15 | if ($position !== null) { |
||
16 | $position++; |
||
17 | $msg = "Token #$position: $msg"; |
||
18 | } |
||
19 | parent::__construct($msg); |
||
20 | } |
||
21 | |||
22 | /** |
||
23 | * @param mixed $x |
||
24 | * @return string |
||
25 | */ |
||
26 | protected function stringify($x): string |
||
31 | ); |
||
32 | } |
||
34 |