99use PHPStan \DependencyInjection \Type \DynamicReturnTypeExtensionRegistryProvider ;
1010use PHPStan \DependencyInjection \Type \ExpressionTypeResolverExtensionRegistryProvider ;
1111use PHPStan \Node \Printer \ExprPrinter ;
12+ use PHPStan \Parser \Parser ;
1213use PHPStan \Php \PhpVersion ;
1314use PHPStan \Reflection \AttributeReflectionFactory ;
1415use PHPStan \Reflection \InitializerExprTypeResolver ;
@@ -24,6 +25,8 @@ final class LazyInternalScopeFactory implements InternalScopeFactory
2425 /** @var int|array{min: int, max: int}|null */
2526 private int |array |null $ phpVersion ;
2627
28+ private Parser $ currentSimpleVersionParser ;
29+
2730 /**
2831 * @param callable(Node $node, Scope $scope): void|null $nodeCallback
2932 */
@@ -34,6 +37,7 @@ public function __construct(
3437 )
3538 {
3639 $ this ->phpVersion = $ this ->container ->getParameter ('phpVersion ' );
40+ $ this ->currentSimpleVersionParser = $ this ->container ->getService ('currentPhpVersionSimpleParser ' );
3741 }
3842
3943 public function create (
@@ -69,7 +73,7 @@ public function create(
6973 $ this ->container ->getByType (ExprPrinter::class),
7074 $ this ->container ->getByType (TypeSpecifier::class),
7175 $ this ->container ->getByType (PropertyReflectionFinder::class),
72- $ this ->container -> getService ( ' currentPhpVersionSimpleParser ' ) ,
76+ $ this ->currentSimpleVersionParser ,
7377 $ this ->container ->getByType (NodeScopeResolver::class),
7478 $ this ->container ->getByType (RicherScopeGetTypeHelper::class),
7579 $ this ->container ->getByType (ConstantResolver::class),
0 commit comments