File tree Expand file tree Collapse file tree 1 file changed +5
-10
lines changed
Expand file tree Collapse file tree 1 file changed +5
-10
lines changed Original file line number Diff line number Diff line change 88use PHPStan \Analyser \Analyser ;
99use PHPStan \Analyser \Fiber \FiberNodeScopeResolver ;
1010use PHPStan \Analyser \FileAnalyser ;
11+ use PHPStan \Analyser \NodeScopeResolver ;
1112use PHPStan \ShouldNotHappenException ;
1213use function getenv ;
1314
@@ -23,17 +24,11 @@ public function beforeCompile()
2324 }
2425
2526 $ builder = $ this ->getContainerBuilder ();
26- $ analyserDef = $ builder ->getDefinitionByType (Analyser::class);
27- if (!$ analyserDef instanceof ServiceDefinition) {
28- throw new ShouldNotHappenException ();
29- }
30- $ analyserDef ->setArgument ('nodeScopeResolver ' , '@ ' . FiberNodeScopeResolver::class);
27+ $ nodeScopeResolverDef = $ builder ->getDefinitionByType (NodeScopeResolver::class);
28+ $ nodeScopeResolverDef ->setAutowired (false );
3129
32- $ fileAnalyserDef = $ builder ->getDefinitionByType (FileAnalyser::class);
33- if (!$ fileAnalyserDef instanceof ServiceDefinition) {
34- throw new ShouldNotHappenException ();
35- }
36- $ fileAnalyserDef ->setArgument ('nodeScopeResolver ' , '@ ' . FiberNodeScopeResolver::class);
30+ $ fiberNodeScopeResolverDef = $ builder ->getDefinitionByType (FiberNodeScopeResolver::class);
31+ $ fiberNodeScopeResolverDef ->setAutowired ([NodeScopeResolver::class, FiberNodeScopeResolver::class]);
3732 }
3833
3934}
You can’t perform that action at this time.
0 commit comments