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 @@ -1871,6 +1871,7 @@ services:
18711871 currentPhpVersionRichParser : @currentPhpVersionRichParser
18721872 currentPhpVersionSimpleParser : @currentPhpVersionSimpleParser
18731873 php8Parser : @php8Parser
1874+ singleReflectionFile : %singleReflectionFile%
18741875 autowired : false
18751876
18761877 # 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 /**
@@ -40,7 +44,7 @@ public function parseFile(string $file): array
4044 }
4145
4246 $ file = $ this ->fileHelper ->normalizePath ($ file );
43- if (!isset ($ this ->analysedFiles [$ file ])) {
47+ if (!isset ($ this ->analysedFiles [$ file ]) && $ file !== $ this -> singleReflectionFile ) {
4448 return $ this ->currentPhpVersionSimpleParser ->parseFile ($ file );
4549 }
4650
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