mirror of
https://github.com/danog/phpdoc-parser.git
synced 2024-11-26 12:04:52 +01:00
ConstExprParser - throw known exception type
This commit is contained in:
parent
34545bb30a
commit
d8e9fd97ca
@ -2,7 +2,6 @@
|
||||
|
||||
namespace PHPStan\PhpDocParser\Parser;
|
||||
|
||||
use LogicException;
|
||||
use PHPStan\PhpDocParser\Ast;
|
||||
use PHPStan\PhpDocParser\Lexer\Lexer;
|
||||
use function strtolower;
|
||||
@ -98,7 +97,12 @@ class ConstExprParser
|
||||
return $this->parseArray($tokens, Lexer::TOKEN_CLOSE_SQUARE_BRACKET);
|
||||
}
|
||||
|
||||
throw new LogicException($tokens->currentTokenValue());
|
||||
throw new ParserException(
|
||||
$tokens->currentTokenValue(),
|
||||
$tokens->currentTokenType(),
|
||||
$tokens->currentTokenOffset(),
|
||||
Lexer::TOKEN_IDENTIFIER
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user