File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -124,7 +124,7 @@ public function tryConsumeTokenType(int $tokenType): bool
124124
125125 public function getSkippedHorizontalWhiteSpaceIfAny (): string
126126 {
127- if ($ this ->tokens [$ this ->index - 1 ][Lexer::TYPE_OFFSET ] === Lexer::TOKEN_HORIZONTAL_WS ) {
127+ if ($ this ->index > 0 && $ this -> tokens [$ this ->index - 1 ][Lexer::TYPE_OFFSET ] === Lexer::TOKEN_HORIZONTAL_WS ) {
128128 return $ this ->tokens [$ this ->index - 1 ][Lexer::VALUE_OFFSET ];
129129 }
130130
Original file line number Diff line number Diff line change @@ -3410,6 +3410,19 @@ public function dataParseTagValue(): array
34103410 ''
34113411 ),
34123412 ],
3413+ [
3414+ '@var ' ,
3415+ '$foo string[] ' ,
3416+ new InvalidTagValueNode (
3417+ '$foo string[] ' ,
3418+ new \PHPStan \PhpDocParser \Parser \ParserException (
3419+ '$foo ' ,
3420+ Lexer::TOKEN_VARIABLE ,
3421+ 0 ,
3422+ Lexer::TOKEN_IDENTIFIER
3423+ )
3424+ ),
3425+ ],
34133426 ];
34143427 }
34153428
You can’t perform that action at this time.
0 commit comments