@@ -1043,6 +1043,11 @@ private function specifyTypesForConstantStringBinaryExpression(
1043
1043
?Expr $ rootExpr ,
1044
1044
): ?SpecifiedTypes
1045
1045
{
1046
+ $ unwrappedExprNode = $ exprNode ;
1047
+ if ($ exprNode instanceof AlwaysRememberedExpr) {
1048
+ $ unwrappedExprNode = $ exprNode ->getExpr ();
1049
+ }
1050
+
1046
1051
if (
1047
1052
$ context ->truthy ()
1048
1053
&& $ exprNode instanceof FuncCall
@@ -1075,10 +1080,10 @@ private function specifyTypesForConstantStringBinaryExpression(
1075
1080
}
1076
1081
1077
1082
if (
1078
- $ exprNode instanceof FuncCall
1079
- && $ exprNode ->name instanceof Name
1080
- && strtolower ($ exprNode ->name ->toString ()) === 'gettype '
1081
- && isset ($ exprNode ->getArgs ()[0 ])
1083
+ $ unwrappedExprNode instanceof FuncCall
1084
+ && $ unwrappedExprNode ->name instanceof Name
1085
+ && strtolower ($ unwrappedExprNode ->name ->toString ()) === 'gettype '
1086
+ && isset ($ unwrappedExprNode ->getArgs ()[0 ])
1082
1087
) {
1083
1088
$ type = null ;
1084
1089
if ($ constantType ->getValue () === 'string ' ) {
@@ -1107,8 +1112,8 @@ private function specifyTypesForConstantStringBinaryExpression(
1107
1112
}
1108
1113
1109
1114
if ($ type !== null ) {
1110
- $ callType = $ this ->create ($ exprNode , $ constantType , $ context , false , $ scope , $ rootExpr );
1111
- $ argType = $ this ->create ($ exprNode ->getArgs ()[0 ]->value , $ type , $ context , false , $ scope , $ rootExpr );
1115
+ $ callType = $ this ->create ($ unwrappedExprNode , $ constantType , $ context , false , $ scope , $ rootExpr );
1116
+ $ argType = $ this ->create ($ unwrappedExprNode ->getArgs ()[0 ]->value , $ type , $ context , false , $ scope , $ rootExpr );
1112
1117
return $ callType ->unionWith ($ argType );
1113
1118
}
1114
1119
}
0 commit comments