getLexerOptions())); } /** * Create a parser targeting the host PHP version, that is the PHP version we're currently * running on. This parser will not use any token emulation. * * All supported lexer attributes (comments, startLine, endLine, startTokenPos, endTokenPos, * startFilePos, endFilePos) will be enabled. */ public function createForHostVersion() : \PhpParser\Parser { return new Php7(new \PhpParser\Lexer($this->getLexerOptions())); } private function getLexerOptions() : array { return ['usedAttributes' => ['comments', 'startLine', 'endLine', 'startTokenPos', 'endTokenPos', 'startFilePos', 'endFilePos']]; } }