Skip to content

Commit

Permalink
[BCB] Parameter $context of NodeScopeResolver::processStmtNodes()
Browse files Browse the repository at this point in the history
… made required
  • Loading branch information
ondrejmirtes committed Sep 14, 2024
1 parent 1648f00 commit 4b6ac9c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
1 change: 1 addition & 0 deletions UPGRADING.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,4 @@ This method now longer accepts `Expr $rootExpr`. If you want to change it, call
### Minor backward compatibility breaks

* 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
* Parameter `StatementContext $context` of [`NodeScopeResolver::processStmtNodes()`](https://apiref.phpstan.org/2.0.x/PHPStan.Analyser.NodeScopeResolver.html#_processStmtNodes) made required
5 changes: 1 addition & 4 deletions src/Analyser/NodeScopeResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -329,12 +329,9 @@ public function processStmtNodes(
array $stmts,
MutatingScope $scope,
callable $nodeCallback,
?StatementContext $context = null,
StatementContext $context,
): StatementResult
{
if ($context === null) {
$context = StatementContext::createTopLevel();
}
$exitPoints = [];
$throwPoints = [];
$impurePoints = [];
Expand Down
1 change: 1 addition & 0 deletions tests/PHPStan/Analyser/StatementResultTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,7 @@ public function testIsAlwaysTerminating(
$scope,
static function (): void {
},
StatementContext::createTopLevel(),
);
$this->assertSame($expectedIsAlwaysTerminating, $result->isAlwaysTerminating());
}
Expand Down

0 comments on commit 4b6ac9c

Please sign in to comment.