Skip to content

Commit 11bfbfe

Browse files
Rework
1 parent 9ca2718 commit 11bfbfe

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/Analyser/MutatingScope.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2987,7 +2987,7 @@ private static function intersectButNotNever(Type $nativeType, Type $inferredTyp
29872987
return $result;
29882988
}
29892989

2990-
public function enterMatch(Expr\Match_ $expr, ?Type $condType, ?Type $condNativeType): self
2990+
public function enterMatch(Expr\Match_ $expr, Type $condType, Type $condNativeType): self
29912991
{
29922992
if ($expr->cond instanceof Variable) {
29932993
return $this;
@@ -3001,8 +3001,8 @@ public function enterMatch(Expr\Match_ $expr, ?Type $condType, ?Type $condNative
30013001
return $this;
30023002
}
30033003

3004-
$type = $condType ?? $this->getType($cond);
3005-
$nativeType = $condNativeType ?? $this->getNativeType($cond);
3004+
$type = $condType;
3005+
$nativeType = $condNativeType;
30063006
$condExpr = new AlwaysRememberedExpr($cond, $type, $nativeType);
30073007
$expr->cond = $condExpr;
30083008

src/Analyser/NodeScopeResolver.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4190,7 +4190,7 @@ function (MutatingScope $scope) use ($stmt, $expr, $nodeCallback, $context, $sto
41904190
$throwPoints = $condResult->getThrowPoints();
41914191
$impurePoints = $condResult->getImpurePoints();
41924192
$isAlwaysTerminating = $condResult->isAlwaysTerminating();
4193-
$matchScope = $scope->enterMatch($expr, $condIsIncDec ? $condType : null, $condIsIncDec ? $condNativeType : null);
4193+
$matchScope = $scope->enterMatch($expr, $condType, $condNativeType);
41944194
$armNodes = [];
41954195
$hasDefaultCond = false;
41964196
$hasAlwaysTrueCond = false;

0 commit comments

Comments
 (0)