Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit d8e9fd9

Browse files
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

‎src/Parser/ConstExprParser.php

Lines changed: 6 additions & 2 deletions
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)

AltStyle によって変換されたページ (->オリジナル) /