private function parse($code)
    {
        try {
            return $this->parser->parse($code);
        } catch (\PhpParser\Error $e) {
            if (\strpos($e->getMessage(), 'unexpected EOF') === false) {
                throw $e;
            }

            // If we got an unexpected EOF, let's try it again with a semicolon.
            return $this->parser->parse($code . ';');
        }
    }
private function parse($code)
    {
        try {
            return $this->parser->parse($code);
        } catch (\PhpParser\Error $e) {
            if (\strpos($e->getMessage(), 'unexpected EOF') === false) {
                throw $e;
            }

            // If we got an unexpected EOF, let's try it again with a semicolon.
            return $this->parser->parse($code . ';');
        }
    }
private function parse ( $ code ) { try { return $ this -> parser -> parse ( $ code ) ; } catch ( \ PhpParser \ Error $ e ) { if ( \ strpos ( $ e -> getMessage ( ) , 'unexpected EOF' ) === false ) { throw $ e ; } // If we got an unexpected EOF, let's try it again with a semicolon. return $ this -> parser -> parse ( $ code . ';' ) ; } }
Lex and parse a string of code into statements.

@param string $code

@return array Statements
Lex and parse a string of code into statements .