Skip to content

Commit 4b6ac9c

Browse files
committed
[BCB] Parameter $context of NodeScopeResolver::processStmtNodes() made required
1 parent 1648f00 commit 4b6ac9c

File tree

3 files changed

+3
-4
lines changed

3 files changed

+3
-4
lines changed

UPGRADING.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,3 +51,4 @@ This method now longer accepts `Expr $rootExpr`. If you want to change it, call
5151
### Minor backward compatibility breaks
5252

5353
* Parameter `$callableParameters` of [`MutatingScope::enterAnonymousFunction()`](https://apiref.phpstan.org/2.0.x/PHPStan.Analyser.MutatingScope.html#_enterAnonymousFunction) and [`enterArrowFunction()`](https://apiref.phpstan.org/2.0.x/PHPStan.Analyser.MutatingScope.html#_enterArrowFunction) made required
54+
* Parameter `StatementContext $context` of [`NodeScopeResolver::processStmtNodes()`](https://apiref.phpstan.org/2.0.x/PHPStan.Analyser.NodeScopeResolver.html#_processStmtNodes) made required

src/Analyser/NodeScopeResolver.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -329,12 +329,9 @@ public function processStmtNodes(
329329
array $stmts,
330330
MutatingScope $scope,
331331
callable $nodeCallback,
332-
?StatementContext $context = null,
332+
StatementContext $context,
333333
): StatementResult
334334
{
335-
if ($context === null) {
336-
$context = StatementContext::createTopLevel();
337-
}
338335
$exitPoints = [];
339336
$throwPoints = [];
340337
$impurePoints = [];

tests/PHPStan/Analyser/StatementResultTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -406,6 +406,7 @@ public function testIsAlwaysTerminating(
406406
$scope,
407407
static function (): void {
408408
},
409+
StatementContext::createTopLevel(),
409410
);
410411
$this->assertSame($expectedIsAlwaysTerminating, $result->isAlwaysTerminating());
411412
}

0 commit comments

Comments
 (0)