/** * @param string $body * @return Token */ private function lexOne($body) { $lexer = new Lexer(new Source($body)); return $lexer->advance(); }
/** * @return NamedType[] */ function parseImplementsInterfaces() { $types = []; if ($this->lexer->token->value === 'implements') { $this->lexer->advance(); do { $types[] = $this->parseNamedType(); } while ($this->peek(Token::NAME)); } return $types; }