File tree Expand file tree Collapse file tree 1 file changed +12
-6
lines changed
Expand file tree Collapse file tree 1 file changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -1119,14 +1119,20 @@ public function specifyTypesInCondition(
11191119 return $ this ->specifyTypesInCondition ($ scope , $ expr ->expr , $ context )->setRootExpr ($ expr );
11201120 } elseif (
11211121 $ expr instanceof Expr \Ternary
1122- && !$ context ->null ()
11231122 && !$ expr ->cond instanceof Expr \Ternary
1123+ && !$ context ->null ()
11241124 ) {
1125- $ ifExpr = $ expr ->if ?? $ expr ->cond ;
1126- $ conditionExpr = new BooleanOr (
1127- new BooleanAnd ($ expr ->cond , $ ifExpr ),
1128- new BooleanAnd (new Expr \BooleanNot ($ expr ->cond ), $ expr ->else ),
1129- );
1125+ if ($ expr ->if !== null ) {
1126+ $ conditionExpr = new BooleanOr (
1127+ new BooleanAnd ($ expr ->cond , $ expr ->if ),
1128+ new BooleanAnd (new Expr \BooleanNot ($ expr ->cond ), $ expr ->else ),
1129+ );
1130+ } else {
1131+ $ conditionExpr = new BooleanOr (
1132+ $ expr ->cond ,
1133+ new BooleanAnd (new Expr \BooleanNot ($ expr ->cond ), $ expr ->else ),
1134+ );
1135+ }
11301136
11311137 return $ this ->specifyTypesInCondition ($ scope , $ conditionExpr , $ context )->setRootExpr ($ expr );
11321138
You can’t perform that action at this time.
0 commit comments