@@ -167,10 +167,6 @@ public function specifyTypesInCondition(
167
167
return $ this ->create ($ exprNode , new ObjectWithoutClassType (), $ context , false , $ scope );
168
168
}
169
169
} elseif ($ expr instanceof Node \Expr \BinaryOp \Identical) {
170
- if ($ expr ->left instanceof Expr \CallLike && $ expr ->right instanceof Expr \CallLike) {
171
- return new SpecifiedTypes ();
172
- }
173
-
174
170
$ expressions = $ this ->findTypeExpressionsFromBinaryOperation ($ scope , $ expr );
175
171
if ($ expressions !== null ) {
176
172
/** @var Expr $exprNode */
@@ -263,6 +259,12 @@ public function specifyTypesInCondition(
263
259
);
264
260
}
265
261
262
+ $ exprLeftType = $ scope ->getType ($ expr ->left );
263
+ $ exprRightType = $ scope ->getType ($ expr ->right );
264
+ if ($ expr ->left instanceof Expr \CallLike && $ expr ->right instanceof Expr \CallLike && !$ exprLeftType instanceof ConstantType && !$ exprRightType instanceof ConstantType) {
265
+ return new SpecifiedTypes ();
266
+ }
267
+
266
268
if ($ context ->true ()) {
267
269
$ type = TypeCombinator::intersect ($ scope ->getType ($ expr ->right ), $ scope ->getType ($ expr ->left ));
268
270
$ leftTypes = $ this ->create ($ expr ->left , $ type , $ context , false , $ scope );
@@ -279,9 +281,6 @@ public function specifyTypesInCondition(
279
281
return $ leftTypes ->unionWith ($ rightTypes );
280
282
}
281
283
282
- $ exprLeftType = $ scope ->getType ($ expr ->left );
283
- $ exprRightType = $ scope ->getType ($ expr ->right );
284
-
285
284
$ types = null ;
286
285
287
286
if (
@@ -333,10 +332,6 @@ public function specifyTypesInCondition(
333
332
$ context ,
334
333
);
335
334
} elseif ($ expr instanceof Node \Expr \BinaryOp \Equal) {
336
- if ($ expr ->left instanceof Expr \CallLike && $ expr ->right instanceof Expr \CallLike) {
337
- return new SpecifiedTypes ();
338
- }
339
-
340
335
$ expressions = $ this ->findTypeExpressionsFromBinaryOperation ($ scope , $ expr );
341
336
if ($ expressions !== null ) {
342
337
/** @var Expr $exprNode */
@@ -362,6 +357,9 @@ public function specifyTypesInCondition(
362
357
363
358
$ leftType = $ scope ->getType ($ expr ->left );
364
359
$ rightType = $ scope ->getType ($ expr ->right );
360
+ if ($ expr ->left instanceof Expr \CallLike && $ expr ->right instanceof Expr \CallLike && !$ leftType instanceof ConstantType && !$ rightType instanceof ConstantType) {
361
+ return new SpecifiedTypes ();
362
+ }
365
363
366
364
$ leftBooleanType = $ leftType ->toBoolean ();
367
365
if ($ leftBooleanType instanceof ConstantBooleanType && $ rightType instanceof BooleanType) {
0 commit comments