File tree Expand file tree Collapse file tree 2 files changed +26
-2
lines changed Expand file tree Collapse file tree 2 files changed +26
-2
lines changed Original file line number Diff line number Diff line change @@ -83,8 +83,8 @@ private function generateRegexp(): string
83
83
self ::TOKEN_OPEN_PARENTHESIS => '\\( ' ,
84
84
self ::TOKEN_CLOSE_PARENTHESIS => '\\) ' ,
85
85
86
- // everything except whitespaces, TOKEN_CLOSE_PARENTHESIS
87
- self ::TOKEN_OTHER => '(?:(?! \\ )) [^ \\s])++ ' ,
86
+ // everything except whitespaces and parentheses
87
+ self ::TOKEN_OTHER => '([^ \\s \\ ) \\ ( ])++ ' ,
88
88
];
89
89
90
90
foreach ($ patterns as $ type => &$ pattern ) {
Original file line number Diff line number Diff line change @@ -237,6 +237,30 @@ public function dataLinesToIgnore(): iterable
237
237
2 => ['identifier ' ],
238
238
],
239
239
];
240
+
241
+ yield [
242
+ '<?php ' . PHP_EOL .
243
+ 'test(); // @phpstan-ignore identifier (var_export() is used intentionally) ' . PHP_EOL ,
244
+ [
245
+ 2 => ['identifier ' ],
246
+ ],
247
+ ];
248
+
249
+ yield [
250
+ '<?php ' . PHP_EOL .
251
+ 'test(); // @phpstan-ignore identifier (FileSystem::write() does not support LOCK_EX) ' . PHP_EOL ,
252
+ [
253
+ 2 => ['identifier ' ],
254
+ ],
255
+ ];
256
+
257
+ yield [
258
+ '<?php ' . PHP_EOL .
259
+ 'test(); // @phpstan-ignore identifier (type ensured in self::createClient()) ' . PHP_EOL ,
260
+ [
261
+ 2 => ['identifier ' ],
262
+ ],
263
+ ];
240
264
}
241
265
242
266
/**
You can’t perform that action at this time.
0 commit comments