1 | <?php |
||
18 | class SyntaxErrorException extends \RuntimeException |
||
19 | { |
||
20 | /** |
||
21 | * @var int |
||
22 | */ |
||
23 | private $error_line; |
||
24 | /** |
||
25 | * @var string |
||
26 | */ |
||
27 | private $unexpected_char; |
||
28 | /** |
||
29 | * @var string |
||
30 | */ |
||
31 | private $messageTemplate = "Parse error: syntax error, unexpected '%s' on line %d."; |
||
32 | |||
33 | /** |
||
34 | * SyntaxErrorException constructor. |
||
35 | * |
||
36 | * @param StringStream $stream |
||
37 | * @param int $code |
||
38 | * @param Exception|null $previous |
||
39 | */ |
||
40 | 1 | public function __construct(StringStream $stream, int $code = 0, Exception $previous = NULL) |
|
51 | |||
52 | /** |
||
53 | * @internal |
||
54 | * @param StringStream $stream |
||
55 | * @return int |
||
56 | */ |
||
57 | 1 | private function getParseErrorLineNumber(StringStream $stream) : int |
|
72 | |||
73 | /** |
||
74 | * @param StringStream $stream |
||
75 | * @return string |
||
76 | */ |
||
77 | 1 | private function getFullString(StringStream $stream) : string |
|
88 | |||
89 | /** |
||
90 | * @return int |
||
91 | */ |
||
92 | public function getErrorLine() |
||
96 | |||
97 | /** |
||
98 | * @return string |
||
99 | */ |
||
100 | public function getUnexpectedChar() |
||
104 | } |