diff --git a/src/Parsing/UnexpectedTokenException.php b/src/Parsing/UnexpectedTokenException.php index c89474c7..8a16794c 100644 --- a/src/Parsing/UnexpectedTokenException.php +++ b/src/Parsing/UnexpectedTokenException.php @@ -9,38 +9,20 @@ */ class UnexpectedTokenException extends SourceException { - /** - * @var string - */ - private $expected; - - /** - * @var string - */ - private $found; - - /** - * @var 'literal'|'identifier'|'count'|'expression'|'search'|'custom' - */ - private $matchType; - /** * @param 'literal'|'identifier'|'count'|'expression'|'search'|'custom' $matchType * @param int<0, max> $lineNumber */ public function __construct(string $expected, string $found, string $matchType = 'literal', int $lineNumber = 0) { - $this->expected = $expected; - $this->found = $found; - $this->matchType = $matchType; $message = "Token “{$expected}” ({$matchType}) not found. Got “{$found}”."; - if ($this->matchType === 'search') { + if ($matchType === 'search') { $message = "Search for “{$expected}” returned no results. Context: “{$found}”."; - } elseif ($this->matchType === 'count') { + } elseif ($matchType === 'count') { $message = "Next token was expected to have {$expected} chars. Context: “{$found}”."; - } elseif ($this->matchType === 'identifier') { + } elseif ($matchType === 'identifier') { $message = "Identifier expected. Got “{$found}”"; - } elseif ($this->matchType === 'custom') { + } elseif ($matchType === 'custom') { $message = \trim("$expected $found"); }