Skip to content

Commit b41f520

Browse files
committed
Move code around a bit
1 parent 2c08dfa commit b41f520

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

src/Analyser/MutatingScope.php

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1318,12 +1318,6 @@ static function (Node $node, Scope $scope) use ($arrowScope, &$arrowFunctionImpu
13181318
$impurePoints = array_merge($arrowFunctionImpurePoints, $arrowFunctionExprResult->getImpurePoints());
13191319
$usedVariables = [];
13201320
} else {
1321-
$closureScope = $this->enterAnonymousFunctionWithoutReflection($node, $callableParameters);
1322-
$closureReturnStatements = [];
1323-
$closureYieldStatements = [];
1324-
$closureExecutionEnds = [];
1325-
$closureImpurePoints = [];
1326-
$invalidateExpressions = [];
13271321
if (self::$resolveClosureTypeDepth >= 2) {
13281322
return new ClosureType(
13291323
$parameters,
@@ -1333,6 +1327,14 @@ static function (Node $node, Scope $scope) use ($arrowScope, &$arrowFunctionImpu
13331327
}
13341328

13351329
self::$resolveClosureTypeDepth++;
1330+
1331+
$closureScope = $this->enterAnonymousFunctionWithoutReflection($node, $callableParameters);
1332+
$closureReturnStatements = [];
1333+
$closureYieldStatements = [];
1334+
$closureExecutionEnds = [];
1335+
$closureImpurePoints = [];
1336+
$invalidateExpressions = [];
1337+
13361338
try {
13371339
$closureStatementResult = $this->nodeScopeResolver->processStmtNodes($node, $node->stmts, $closureScope, static function (Node $node, Scope $scope) use ($closureScope, &$closureReturnStatements, &$closureYieldStatements, &$closureExecutionEnds, &$closureImpurePoints, &$invalidateExpressions): void {
13381340
if ($scope->getAnonymousFunctionReflection() !== $closureScope->getAnonymousFunctionReflection()) {

0 commit comments

Comments
 (0)