function ParserAbstract::getErrorMessage
Format error message including expected tokens.
Parameters
int $symbol Unexpected symbol:
int $state State at time of error:
Return value
string Formatted error message
1 call to ParserAbstract::getErrorMessage()
- ParserAbstract::doParse in vendor/
nikic/ php-parser/ lib/ PhpParser/ ParserAbstract.php
File
-
vendor/
nikic/ php-parser/ lib/ PhpParser/ ParserAbstract.php, line 430
Class
Namespace
PhpParserCode
protected function getErrorMessage(int $symbol, int $state) : string {
$expectedString = '';
if ($expected = $this->getExpectedTokens($state)) {
$expectedString = ', expecting ' . implode(' or ', $expected);
}
return 'Syntax error, unexpected ' . $this->symbolToName[$symbol] . $expectedString;
}