File tree 1 file changed +4
-6
lines changed
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
552
552
throw new UndefinedVariableException ($ this , $ variableName );
553
553
}
554
554
555
- $ defaultType = new MixedType ();
556
- if ($ this ->isGlobalVariable ($ variableName )) {
557
- $ defaultType = new ArrayType (new BenevolentUnionType ([new IntegerType (), new StringType ()]), new MixedType (true ));
558
- }
559
-
560
555
$ varExprString = '$ ' . $ variableName ;
561
556
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 ();
563
561
}
564
562
565
563
return TypeUtils::resolveLateResolvableTypes ($ this ->expressionTypes [$ varExprString ]->getType ());
You can’t perform that action at this time.
0 commit comments