Skip to content

Commit

Permalink
Resolve notice on undefined index
Browse files Browse the repository at this point in the history
fixes #384
  • Loading branch information
jaapio committed Nov 6, 2024
1 parent 54e10d4 commit 0c70d2c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@ parameters:
level: max
ignoreErrors:
- '#Method phpDocumentor\\Reflection\\DocBlock\\StandardTagFactory::createTag\(\) should return phpDocumentor\\Reflection\\DocBlock\\Tag but returns mixed#'
- '#Offset 2 on array\{string, 28, int\} on left side of \?\? always exists and is not nullable\.#'
paths:
- src
4 changes: 2 additions & 2 deletions src/DocBlock/Tags/Factory/AbstractPHPStanFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,12 @@ private function tokenizeLine(string $tagLine): TokenIterator
$fixed[] = [
rtrim($token[Lexer::VALUE_OFFSET], " \t"),
Lexer::TOKEN_PHPDOC_EOL,
$token[2],
$token[2] ?? 0,
];
$fixed[] = [
ltrim($token[Lexer::VALUE_OFFSET], "\n\r"),
Lexer::TOKEN_HORIZONTAL_WS,
$token[2] + 1,
($token[2] ?? 0) + 1,
];
continue;
}
Expand Down

0 comments on commit 0c70d2c

Please sign in to comment.