File tree 2 files changed +14
-1
lines changed
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
124
124
125
125
public function getSkippedHorizontalWhiteSpaceIfAny (): string
126
126
{
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 ) {
128
128
return $ this ->tokens [$ this ->index - 1 ][Lexer::VALUE_OFFSET ];
129
129
}
130
130
Original file line number Diff line number Diff line change @@ -3410,6 +3410,19 @@ public function dataParseTagValue(): array
3410
3410
''
3411
3411
),
3412
3412
],
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
+ ],
3413
3426
];
3414
3427
}
3415
3428
You can’t perform that action at this time.
0 commit comments