File tree Expand file tree Collapse file tree 3 files changed +8
-2
lines changed Expand file tree Collapse file tree 3 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -1820,6 +1820,7 @@ services:
18201820 currentPhpVersionRichParser : @currentPhpVersionRichParser
18211821 currentPhpVersionSimpleParser : @currentPhpVersionSimpleParser
18221822 php8Parser : @php8Parser
1823+ singleReflectionFile : %singleReflectionFile%
18231824 autowired : false
18241825
18251826 # Error formatters
Original file line number Diff line number Diff line change 99class PathRoutingParser implements Parser
1010{
1111
12+ private ?string $ singleReflectionFile ;
13+
1214 /** @var bool[] filePath(string) => bool(true) */
1315 private array $ analysedFiles = [];
1416
@@ -17,8 +19,10 @@ public function __construct(
1719 private Parser $ currentPhpVersionRichParser ,
1820 private Parser $ currentPhpVersionSimpleParser ,
1921 private Parser $ php8Parser ,
22+ ?string $ singleReflectionFile ,
2023 )
2124 {
25+ $ this ->singleReflectionFile = $ singleReflectionFile !== null ? $ fileHelper ->normalizePath ($ singleReflectionFile ) : null ;
2226 }
2327
2428 /**
@@ -36,7 +40,7 @@ public function parseFile(string $file): array
3640 }
3741
3842 $ file = $ this ->fileHelper ->normalizePath ($ file );
39- if (!isset ($ this ->analysedFiles [$ file ])) {
43+ if (!isset ($ this ->analysedFiles [$ file ]) && $ file !== $ this -> singleReflectionFile ) {
4044 return $ this ->currentPhpVersionSimpleParser ->parseFile ($ file );
4145 }
4246
Original file line number Diff line number Diff line change @@ -89,7 +89,8 @@ public function testParseTheSameFileWithDifferentMethod(): void
8989 $ fileHelper ,
9090 self ::getContainer ()->getService ('currentPhpVersionRichParser ' ),
9191 self ::getContainer ()->getService ('currentPhpVersionSimpleDirectParser ' ),
92- self ::getContainer ()->getService ('php8Parser ' )
92+ self ::getContainer ()->getService ('php8Parser ' ),
93+ null
9394 );
9495 $ parser = new CachedParser ($ pathRoutingParser , 500 );
9596 $ path = $ fileHelper ->normalizePath (__DIR__ . '/data/test.php ' );
You can’t perform that action at this time.
0 commit comments