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:
1820
1820
currentPhpVersionRichParser : @currentPhpVersionRichParser
1821
1821
currentPhpVersionSimpleParser : @currentPhpVersionSimpleParser
1822
1822
php8Parser : @php8Parser
1823
+ singleReflectionFile : %singleReflectionFile%
1823
1824
autowired : false
1824
1825
1825
1826
# Error formatters
Original file line number Diff line number Diff line change 9
9
class PathRoutingParser implements Parser
10
10
{
11
11
12
+ private ?string $ singleReflectionFile ;
13
+
12
14
/** @var bool[] filePath(string) => bool(true) */
13
15
private array $ analysedFiles = [];
14
16
@@ -17,8 +19,10 @@ public function __construct(
17
19
private Parser $ currentPhpVersionRichParser ,
18
20
private Parser $ currentPhpVersionSimpleParser ,
19
21
private Parser $ php8Parser ,
22
+ ?string $ singleReflectionFile ,
20
23
)
21
24
{
25
+ $ this ->singleReflectionFile = $ singleReflectionFile !== null ? $ fileHelper ->normalizePath ($ singleReflectionFile ) : null ;
22
26
}
23
27
24
28
/**
@@ -36,7 +40,7 @@ public function parseFile(string $file): array
36
40
}
37
41
38
42
$ file = $ this ->fileHelper ->normalizePath ($ file );
39
- if (!isset ($ this ->analysedFiles [$ file ])) {
43
+ if (!isset ($ this ->analysedFiles [$ file ]) && $ file !== $ this -> singleReflectionFile ) {
40
44
return $ this ->currentPhpVersionSimpleParser ->parseFile ($ file );
41
45
}
42
46
Original file line number Diff line number Diff line change @@ -89,7 +89,8 @@ public function testParseTheSameFileWithDifferentMethod(): void
89
89
$ fileHelper ,
90
90
self ::getContainer ()->getService ('currentPhpVersionRichParser ' ),
91
91
self ::getContainer ()->getService ('currentPhpVersionSimpleDirectParser ' ),
92
- self ::getContainer ()->getService ('php8Parser ' )
92
+ self ::getContainer ()->getService ('php8Parser ' ),
93
+ null
93
94
);
94
95
$ parser = new CachedParser ($ pathRoutingParser , 500 );
95
96
$ path = $ fileHelper ->normalizePath (__DIR__ . '/data/test.php ' );
You can’t perform that action at this time.
0 commit comments