Skip to content

Commit 642dcd1

Browse files
committed
Parser services reorganization
1 parent aa502ff commit 642dcd1

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

conf/config.neon

+13-6
Original file line numberDiff line numberDiff line change
@@ -281,9 +281,6 @@ services:
281281
-
282282
class: PhpParser\NodeVisitor\NodeConnectingVisitor
283283

284-
-
285-
class: PhpParser\Parser\Php7
286-
287284
-
288285
class: PhpParser\PrettyPrinter\Standard
289286

@@ -522,7 +519,7 @@ services:
522519
-
523520
class: PHPStan\Parser\CachedParser
524521
arguments:
525-
originalParser: @directParser
522+
originalParser: @currentPhpVersionParser
526523
cachedNodesByStringCountMax: %cache.nodesByStringCountMax%
527524

528525
-
@@ -1176,8 +1173,11 @@ services:
11761173
directory: %tmpDir%/cache/PHPStan
11771174
autowired: no
11781175

1179-
directParser:
1176+
currentPhpVersionParser:
11801177
class: PHPStan\Parser\DirectParser
1178+
arguments:
1179+
parser: @currentPhpVersionPhpParser
1180+
lexer: @currentPhpVersionLexer
11811181
autowired: no
11821182

11831183
phpParserDecorator:
@@ -1186,9 +1186,16 @@ services:
11861186
wrappedParser: @PHPStan\Parser\Parser
11871187
autowired: no
11881188

1189-
phpParserLexer:
1189+
currentPhpVersionLexer:
11901190
class: PhpParser\Lexer
11911191
factory: @PHPStan\Parser\LexerFactory::create()
1192+
autowired: false
1193+
1194+
currentPhpVersionPhpParser:
1195+
class: PhpParser\Parser\Php7
1196+
arguments:
1197+
lexer: @currentPhpVersionLexer
1198+
autowired: false
11921199

11931200
registry:
11941201
class: PHPStan\Rules\Registry

0 commit comments

Comments
 (0)