Skip to content

Commit a3416eb

Browse files
committed
Reorganize configs a bit
1 parent 835dbb0 commit a3416eb

File tree

5 files changed

+181
-166
lines changed

5 files changed

+181
-166
lines changed

conf/config.neon

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
includes:
22
- parametersSchema.neon
33
- services.neon
4+
- parsers.neon
45

56
parameters:
67
bootstrapFiles:

conf/config.stubValidator.neon

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,30 @@ services:
1111
arguments:
1212
php8Parser: @php8PhpParser
1313

14+
# overrides service from parsers.neon
1415
defaultAnalysisParser!:
1516
factory: @stubParser
1617

18+
# overrides service from services.neon
1719
nodeScopeResolverReflector:
1820
factory: @stubReflector
1921

22+
# overrides service from services.neon
23+
reflectionProvider:
24+
factory: @stubBetterReflectionProvider
25+
autowired:
26+
- PHPStan\Reflection\ReflectionProvider
27+
28+
# overrides service from parsers.neon
29+
currentPhpVersionLexer:
30+
factory: @php8Lexer
31+
autowired: false
32+
33+
# overrides service from parsers.neon
34+
currentPhpVersionPhpParser:
35+
factory: @php8PhpParser
36+
autowired: false
37+
2038
stubBetterReflectionProvider:
2139
class: PHPStan\Reflection\BetterReflection\BetterReflectionProvider
2240
arguments:
@@ -34,16 +52,3 @@ services:
3452
class: PHPStan\BetterReflection\SourceLocator\Type\SourceLocator
3553
factory: @PHPStan\PhpDoc\StubSourceLocatorFactory::create()
3654
autowired: false
37-
38-
reflectionProvider:
39-
factory: @stubBetterReflectionProvider
40-
autowired:
41-
- PHPStan\Reflection\ReflectionProvider
42-
43-
currentPhpVersionLexer:
44-
factory: @php8Lexer
45-
autowired: false
46-
47-
currentPhpVersionPhpParser:
48-
factory: @php8PhpParser
49-
autowired: false

conf/parsers.neon

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
services:
2+
php8Parser:
3+
class: PHPStan\Parser\SimpleParser
4+
arguments:
5+
parser: @php8PhpParser
6+
autowired: false
7+
8+
php8Lexer:
9+
class: PhpParser\Lexer\Emulative
10+
factory: @PHPStan\Parser\LexerFactory::createEmulative()
11+
autowired: false
12+
13+
php8PhpParser:
14+
class: PhpParser\Parser\Php8
15+
arguments:
16+
lexer: @php8Lexer
17+
autowired: false
18+
19+
currentPhpVersionLexer:
20+
class: PhpParser\Lexer
21+
factory: @PHPStan\Parser\LexerFactory::create()
22+
autowired: false
23+
24+
currentPhpVersionPhpParser:
25+
factory: @currentPhpVersionPhpParserFactory::create()
26+
autowired: false
27+
28+
currentPhpVersionPhpParserFactory:
29+
class: PHPStan\Parser\PhpParserFactory
30+
arguments:
31+
lexer: @currentPhpVersionLexer
32+
autowired: false
33+
34+
currentPhpVersionSimpleDirectParser:
35+
class: PHPStan\Parser\SimpleParser
36+
arguments:
37+
parser: @currentPhpVersionPhpParser
38+
autowired: no
39+
40+
currentPhpVersionSimpleParser:
41+
class: PHPStan\Parser\CleaningParser
42+
arguments:
43+
wrappedParser: @currentPhpVersionSimpleDirectParser
44+
autowired: no
45+
46+
currentPhpVersionRichParser:
47+
class: PHPStan\Parser\RichParser
48+
arguments:
49+
parser: @currentPhpVersionPhpParser
50+
autowired: no
51+
52+
pathRoutingParser:
53+
class: PHPStan\Parser\PathRoutingParser
54+
arguments:
55+
currentPhpVersionRichParser: @currentPhpVersionRichParser
56+
currentPhpVersionSimpleParser: @currentPhpVersionSimpleParser
57+
php8Parser: @php8Parser
58+
singleReflectionFile: %singleReflectionFile%
59+
autowired: false
60+
61+
phpParserDecorator:
62+
class: PHPStan\Parser\PhpParserDecorator
63+
arguments:
64+
wrappedParser: @defaultAnalysisParser
65+
autowired: false
66+
67+
defaultAnalysisParser:
68+
class: PHPStan\Parser\CachedParser
69+
arguments:
70+
originalParser: @pathRoutingParser
71+
cachedNodesByStringCountMax: %cache.nodesByStringCountMax%
72+
autowired: false
73+
74+
freshStubParser:
75+
class: PHPStan\Parser\StubParser
76+
arguments:
77+
parser: @php8PhpParser
78+
autowired: false
79+
80+
stubParser:
81+
class: PHPStan\Parser\CachedParser
82+
arguments:
83+
originalParser: @freshStubParser
84+
cachedNodesByStringCountMax: %cache.nodesByStringCountMax%
85+
autowired: false

0 commit comments

Comments
 (0)