@@ -4865,68 +4865,6 @@ public function processAlwaysIterableForeachScopeWithoutPollute(self $finalScope
48654865 );
48664866 }
48674867
4868- public function processAlwaysIterableForScopeWithoutPollute (self $ finalScope , self $ initScope ): self
4869- {
4870- $ expressionTypes = $ this ->expressionTypes ;
4871- $ initScopeExpressionTypes = $ initScope ->expressionTypes ;
4872- foreach ($ finalScope ->expressionTypes as $ variableExprString => $ variableTypeHolder ) {
4873- if (!isset ($ expressionTypes [$ variableExprString ])) {
4874- if (isset ($ initScopeExpressionTypes [$ variableExprString ])) {
4875- $ expressionTypes [$ variableExprString ] = ExpressionTypeHolder::createMaybe ($ variableTypeHolder ->getExpr (), $ variableTypeHolder ->getType ());
4876- continue ;
4877- }
4878-
4879- $ expressionTypes [$ variableExprString ] = $ variableTypeHolder ;
4880- continue ;
4881- }
4882-
4883- $ expressionTypes [$ variableExprString ] = new ExpressionTypeHolder (
4884- $ variableTypeHolder ->getExpr (),
4885- $ variableTypeHolder ->getType (),
4886- $ variableTypeHolder ->getCertainty ()->and ($ expressionTypes [$ variableExprString ]->getCertainty ()),
4887- );
4888- }
4889-
4890- $ nativeTypes = $ this ->nativeExpressionTypes ;
4891- $ initScopeNativeExpressionTypes = $ initScope ->nativeExpressionTypes ;
4892- foreach ($ finalScope ->nativeExpressionTypes as $ variableExprString => $ variableTypeHolder ) {
4893- if (!isset ($ nativeTypes [$ variableExprString ])) {
4894- if (isset ($ initScopeNativeExpressionTypes [$ variableExprString ])) {
4895- $ nativeTypes [$ variableExprString ] = ExpressionTypeHolder::createMaybe ($ variableTypeHolder ->getExpr (), $ variableTypeHolder ->getType ());
4896- continue ;
4897- }
4898-
4899- $ nativeTypes [$ variableExprString ] = $ variableTypeHolder ;
4900- continue ;
4901- }
4902-
4903- $ nativeTypes [$ variableExprString ] = new ExpressionTypeHolder (
4904- $ variableTypeHolder ->getExpr (),
4905- $ variableTypeHolder ->getType (),
4906- $ variableTypeHolder ->getCertainty ()->and ($ nativeTypes [$ variableExprString ]->getCertainty ()),
4907- );
4908- }
4909-
4910- return $ this ->scopeFactory ->create (
4911- $ this ->context ,
4912- $ this ->isDeclareStrictTypes (),
4913- $ this ->getFunction (),
4914- $ this ->getNamespace (),
4915- $ expressionTypes ,
4916- $ nativeTypes ,
4917- $ this ->conditionalExpressions ,
4918- $ this ->inClosureBindScopeClasses ,
4919- $ this ->anonymousFunctionReflection ,
4920- $ this ->inFirstLevelStatement ,
4921- [],
4922- [],
4923- [],
4924- $ this ->afterExtractCall ,
4925- $ this ->parentScope ,
4926- $ this ->nativeTypesPromoted ,
4927- );
4928- }
4929-
49304868 public function generalizeWith (self $ otherScope ): self
49314869 {
49324870 $ variableTypeHolders = $ this ->generalizeVariableTypeHolders (
0 commit comments