Skip to content

Commit a2854d1

Browse files
committed
[BCB] Parameter $callableParameters of MutatingScope::enterAnonymousFunction() and enterArrowFunction() made required
1 parent 5962aa1 commit a2854d1

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

UPGRADING.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,3 +47,7 @@ If you want to change `$overwrite` or `$rootExpr` (previous parameters also used
4747
### Changed `TypeSpecifier::specifyTypesInCondition()`
4848

4949
This method now longer accepts `Expr $rootExpr`. If you want to change it, call `setRootExpr()` on [`SpecifiedTypes`](https://apiref.phpstan.org/2.0.x/PHPStan.Analyser.SpecifiedTypes.html) (object returned by `TypeSpecifier::specifyTypesInCondition()`). `setRootExpr()` method returns a new object (SpecifiedTypes is immutable).
50+
51+
### Minor backward compatibility breaks
52+
53+
* 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

src/Analyser/MutatingScope.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3376,7 +3376,7 @@ public function isInClosureBind(): bool
33763376
*/
33773377
public function enterAnonymousFunction(
33783378
Expr\Closure $closure,
3379-
?array $callableParameters = null,
3379+
?array $callableParameters,
33803380
): self
33813381
{
33823382
$anonymousFunctionReflection = $this->getType($closure);
@@ -3411,7 +3411,7 @@ public function enterAnonymousFunction(
34113411
*/
34123412
private function enterAnonymousFunctionWithoutReflection(
34133413
Expr\Closure $closure,
3414-
?array $callableParameters = null,
3414+
?array $callableParameters,
34153415
): self
34163416
{
34173417
$expressionTypes = [];
@@ -3553,7 +3553,7 @@ private function invalidateStaticExpressions(array $expressionTypes): array
35533553
* @api
35543554
* @param ParameterReflection[]|null $callableParameters
35553555
*/
3556-
public function enterArrowFunction(Expr\ArrowFunction $arrowFunction, ?array $callableParameters = null): self
3556+
public function enterArrowFunction(Expr\ArrowFunction $arrowFunction, ?array $callableParameters): self
35573557
{
35583558
$anonymousFunctionReflection = $this->getType($arrowFunction);
35593559
if (!$anonymousFunctionReflection instanceof ClosureType) {

0 commit comments

Comments
 (0)