Skip to content

Commit 0c70d2c

Browse files
committed
Resolve notice on undefined index
fixes #384
1 parent 54e10d4 commit 0c70d2c

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

phpstan.neon

+1
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@ parameters:
22
level: max
33
ignoreErrors:
44
- '#Method phpDocumentor\\Reflection\\DocBlock\\StandardTagFactory::createTag\(\) should return phpDocumentor\\Reflection\\DocBlock\\Tag but returns mixed#'
5+
- '#Offset 2 on array\{string, 28, int\} on left side of \?\? always exists and is not nullable\.#'
56
paths:
67
- src

src/DocBlock/Tags/Factory/AbstractPHPStanFactory.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -104,12 +104,12 @@ private function tokenizeLine(string $tagLine): TokenIterator
104104
$fixed[] = [
105105
rtrim($token[Lexer::VALUE_OFFSET], " \t"),
106106
Lexer::TOKEN_PHPDOC_EOL,
107-
$token[2],
107+
$token[2] ?? 0,
108108
];
109109
$fixed[] = [
110110
ltrim($token[Lexer::VALUE_OFFSET], "\n\r"),
111111
Lexer::TOKEN_HORIZONTAL_WS,
112-
$token[2] + 1,
112+
($token[2] ?? 0) + 1,
113113
];
114114
continue;
115115
}

0 commit comments

Comments
 (0)