Skip to content

Commit

Permalink
Simplify parsing of type alias import
Browse files Browse the repository at this point in the history
  • Loading branch information
jiripudil committed Jun 20, 2022
1 parent 4a07085 commit b34f744
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions src/Parser/PhpDocParser.php
Expand Up @@ -429,14 +429,7 @@ private function parseTypeAliasImportTagValue(TokenIterator $tokens): Ast\PhpDoc
$importedAlias = $tokens->currentTokenValue();
$tokens->consumeTokenType(Lexer::TOKEN_IDENTIFIER);

if (!$tokens->tryConsumeTokenValue('from')) {
throw new ParserException(
$tokens->currentTokenValue(),
$tokens->currentTokenType(),
$tokens->currentTokenOffset(),
Lexer::TOKEN_IDENTIFIER
);
}
$tokens->consumeTokenValue(Lexer::TOKEN_IDENTIFIER, 'from');

$importedFrom = $tokens->currentTokenValue();
$tokens->consumeTokenType(Lexer::TOKEN_IDENTIFIER);
Expand Down

0 comments on commit b34f744

Please sign in to comment.