File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -552,14 +552,12 @@ public function getVariableType(string $variableName): Type
552552 throw new UndefinedVariableException ($ this , $ variableName );
553553 }
554554
555- $ defaultType = new MixedType ();
556- if ($ this ->isGlobalVariable ($ variableName )) {
557- $ defaultType = new ArrayType (new BenevolentUnionType ([new IntegerType (), new StringType ()]), new MixedType (true ));
558- }
559-
560555 $ varExprString = '$ ' . $ variableName ;
561556 if (!array_key_exists ($ varExprString , $ this ->expressionTypes )) {
562- return $ defaultType ;
557+ if ($ this ->isGlobalVariable ($ variableName )) {
558+ return new ArrayType (new BenevolentUnionType ([new IntegerType (), new StringType ()]), new MixedType (true ));
559+ }
560+ return new MixedType ();
563561 }
564562
565563 return TypeUtils::resolveLateResolvableTypes ($ this ->expressionTypes [$ varExprString ]->getType ());
You can’t perform that action at this time.
0 commit comments