private function parseErrorIsEOF(\PHPParser_Error $e) { $msg = $e->getRawMessage(); return $msg === "Unexpected token EOF" || strpos($msg, "Syntax error, unexpected EOF") !== false; }
public function testUnknownLine() { $error = new PHPParser_Error('Some error'); $this->assertEquals(-1, $error->getRawLine()); $this->assertEquals('Some error on unknown line', $error->getMessage()); }
/** * Create a ParseErrorException from a PHPParser Error. * * @param \PHPParser_Error $e * * @return ParseErrorException */ public static function fromParseError(\PHPParser_Error $e) { return new self($e->getRawMessage(), $e->getRawLine()); }