Skip to content

Commit d8e9fd9

Browse files
committed
ConstExprParser - throw known exception type
1 parent 34545bb commit d8e9fd9

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Diff for: src/Parser/ConstExprParser.php

+6-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
namespace PHPStan\PhpDocParser\Parser;
44

5-
use LogicException;
65
use PHPStan\PhpDocParser\Ast;
76
use PHPStan\PhpDocParser\Lexer\Lexer;
87
use function strtolower;
@@ -98,7 +97,12 @@ public function parse(TokenIterator $tokens, bool $trimStrings = false): Ast\Con
9897
return $this->parseArray($tokens, Lexer::TOKEN_CLOSE_SQUARE_BRACKET);
9998
}
10099

101-
throw new LogicException($tokens->currentTokenValue());
100+
throw new ParserException(
101+
$tokens->currentTokenValue(),
102+
$tokens->currentTokenType(),
103+
$tokens->currentTokenOffset(),
104+
Lexer::TOKEN_IDENTIFIER
105+
);
102106
}
103107

104108

0 commit comments

Comments
 (0)