3434use PHPStan \Analyser \TypeSpecifier ;
3535use PHPStan \Analyser \TypeSpecifierContext ;
3636use PHPStan \Analyser \UndefinedVariableException ;
37+ use PHPStan \DependencyInjection \AutowiredParameter ;
38+ use PHPStan \DependencyInjection \GenerateFactory ;
3739use PHPStan \Node \Expr \AlwaysRememberedExpr ;
3840use PHPStan \Node \Expr \IntertwinedVariableByReferenceWithExpr ;
3941use PHPStan \Node \Expr \ParameterVariableOriginalValueExpr ;
127129use const PHP_INT_MAX ;
128130use const PHP_INT_MIN ;
129131
132+ #[GenerateFactory(interface: InternalGeneratorScopeFactory::class)]
130133final class GeneratorScope implements Scope, NodeCallbackInvoker
131134{
132135
@@ -150,11 +153,13 @@ public function __construct(
150153 private TypeSpecifier $ typeSpecifier ,
151154 private ExprPrinter $ exprPrinter ,
152155 private PropertyReflectionFinder $ propertyReflectionFinder ,
156+ #[AutowiredParameter(ref: '@currentPhpVersionSimpleParser ' )]
153157 private Parser $ parser ,
154158 private ConstantResolver $ constantResolver ,
155159 private ScopeContext $ context ,
156160 private PhpVersion $ phpVersion ,
157161 private AttributeReflectionFactory $ attributeReflectionFactory ,
162+ #[AutowiredParameter(ref: '%phpVersion% ' )]
158163 private int |array |null $ configPhpVersion ,
159164 private bool $ declareStrictTypes = false ,
160165 private PhpFunctionFromParserNodeReflection |null $ function = null ,
0 commit comments