Merge branch '0.4.x' into master

This commit is contained in:
Ondrej Mirtes 2021-03-19 11:54:26 +01:00
commit b2169b6c87
No known key found for this signature in database
GPG Key ID: 8E730BA25823D8B5
2 changed files with 14 additions and 1 deletions

View File

@ -124,7 +124,7 @@ class TokenIterator
public function getSkippedHorizontalWhiteSpaceIfAny(): string
{
if ($this->tokens[$this->index - 1][Lexer::TYPE_OFFSET] === Lexer::TOKEN_HORIZONTAL_WS) {
if ($this->index > 0 && $this->tokens[$this->index - 1][Lexer::TYPE_OFFSET] === Lexer::TOKEN_HORIZONTAL_WS) {
return $this->tokens[$this->index - 1][Lexer::VALUE_OFFSET];
}

View File

@ -3410,6 +3410,19 @@ Finder::findFiles('*.php')
''
),
],
[
'@var',
'$foo string[]',
new InvalidTagValueNode(
'$foo string[]',
new \PHPStan\PhpDocParser\Parser\ParserException(
'$foo',
Lexer::TOKEN_VARIABLE,
0,
Lexer::TOKEN_IDENTIFIER
)
),
],
];
}