From ec616eda3a82ddc99b02698418ec7b3538b1acb3 Mon Sep 17 00:00:00 2001 From: Abdul Malik Ikhsan Date: Tue, 17 Mar 2026 17:40:16 +0700 Subject: [PATCH 1/3] Bump PHPStan to ^2.1.41 --- build/target-repository/composer.json | 2 +- composer.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build/target-repository/composer.json b/build/target-repository/composer.json index 6b5f8e0a30d..68290e50bba 100644 --- a/build/target-repository/composer.json +++ b/build/target-repository/composer.json @@ -9,7 +9,7 @@ ], "require": { "php": "^7.4|^8.0", - "phpstan/phpstan": "^2.1.40" + "phpstan/phpstan": "^2.1.41" }, "autoload": { "files": [ diff --git a/composer.json b/composer.json index 48122114326..e7172771349 100644 --- a/composer.json +++ b/composer.json @@ -23,7 +23,7 @@ "nikic/php-parser": "^5.7", "ondram/ci-detector": "^4.2", "phpstan/phpdoc-parser": "^2.3", - "phpstan/phpstan": "^2.1.40", + "phpstan/phpstan": "^2.1.41", "react/event-loop": "^1.6", "react/promise": "^3.3", "react/socket": "^1.17", From 47c3d69bc942783ac405906945c26c4904dfad92 Mon Sep 17 00:00:00 2001 From: Abdul Malik Ikhsan Date: Tue, 17 Mar 2026 04:18:35 +0700 Subject: [PATCH 2/3] Fix latest phpstan assert --- .../Rector/FunctionLike/NarrowWideUnionReturnTypeRector.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rules/DeadCode/Rector/FunctionLike/NarrowWideUnionReturnTypeRector.php b/rules/DeadCode/Rector/FunctionLike/NarrowWideUnionReturnTypeRector.php index b90cc345753..654a66c583b 100644 --- a/rules/DeadCode/Rector/FunctionLike/NarrowWideUnionReturnTypeRector.php +++ b/rules/DeadCode/Rector/FunctionLike/NarrowWideUnionReturnTypeRector.php @@ -126,8 +126,8 @@ public function refactor(Node $node): ?Node $hasImplicitNullReturn = $this->silentVoidResolver->hasSilentVoid($node) || $this->hasImplicitNullReturn($returnStatements); + /** @var UnionType|NullableType $returnType */ $returnType = $node->returnType; - Assert::isInstanceOfAny($returnType, [UnionType::class, NullableType::class]); $returnType = $this->staticTypeMapper->mapPhpParserNodePHPStanType($returnType); $actualReturnTypes = $this->collectActualReturnTypes($returnStatements); From 8ade832218328fd43f46d3fd4cf8a0d4a06dfe30 Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Mon, 16 Mar 2026 21:20:20 +0000 Subject: [PATCH 3/3] [ci-review] Rector Rectify --- .../Rector/FunctionLike/NarrowWideUnionReturnTypeRector.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rules/DeadCode/Rector/FunctionLike/NarrowWideUnionReturnTypeRector.php b/rules/DeadCode/Rector/FunctionLike/NarrowWideUnionReturnTypeRector.php index 654a66c583b..2ecc8ddd341 100644 --- a/rules/DeadCode/Rector/FunctionLike/NarrowWideUnionReturnTypeRector.php +++ b/rules/DeadCode/Rector/FunctionLike/NarrowWideUnionReturnTypeRector.php @@ -35,7 +35,6 @@ use Rector\VersionBonding\Contract\MinPhpVersionInterface; use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample; use Symplify\RuleDocGenerator\ValueObject\RuleDefinition; -use Webmozart\Assert\Assert; /** * @see \Rector\Tests\DeadCode\Rector\FunctionLike\NarrowWideUnionReturnTypeRector\NarrowWideUnionReturnTypeRectorTest @@ -130,6 +129,7 @@ public function refactor(Node $node): ?Node $returnType = $node->returnType; $returnType = $this->staticTypeMapper->mapPhpParserNodePHPStanType($returnType); + $actualReturnTypes = $this->collectActualReturnTypes($returnStatements); if ($hasImplicitNullReturn) {