Skip to content

Commit 3a3942b

Browse files
Bump PHPStan to ^2.1.41 (#7932)
* Bump PHPStan to ^2.1.41 * Fix latest phpstan assert * [ci-review] Rector Rectify --------- Co-authored-by: GitHub Action <actions@github.com>
1 parent 16136f7 commit 3a3942b

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

build/target-repository/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
],
1010
"require": {
1111
"php": "^7.4|^8.0",
12-
"phpstan/phpstan": "^2.1.40"
12+
"phpstan/phpstan": "^2.1.41"
1313
},
1414
"autoload": {
1515
"files": [

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"nikic/php-parser": "^5.7",
2424
"ondram/ci-detector": "^4.2",
2525
"phpstan/phpdoc-parser": "^2.3",
26-
"phpstan/phpstan": "^2.1.40",
26+
"phpstan/phpstan": "^2.1.41",
2727
"react/event-loop": "^1.6",
2828
"react/promise": "^3.3",
2929
"react/socket": "^1.17",

rules/DeadCode/Rector/FunctionLike/NarrowWideUnionReturnTypeRector.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
use Rector\VersionBonding\Contract\MinPhpVersionInterface;
3636
use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample;
3737
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;
38-
use Webmozart\Assert\Assert;
3938

4039
/**
4140
* @see \Rector\Tests\DeadCode\Rector\FunctionLike\NarrowWideUnionReturnTypeRector\NarrowWideUnionReturnTypeRectorTest
@@ -126,10 +125,11 @@ public function refactor(Node $node): ?Node
126125
$hasImplicitNullReturn = $this->silentVoidResolver->hasSilentVoid($node)
127126
|| $this->hasImplicitNullReturn($returnStatements);
128127

128+
/** @var UnionType|NullableType $returnType */
129129
$returnType = $node->returnType;
130-
Assert::isInstanceOfAny($returnType, [UnionType::class, NullableType::class]);
131130

132131
$returnType = $this->staticTypeMapper->mapPhpParserNodePHPStanType($returnType);
132+
133133
$actualReturnTypes = $this->collectActualReturnTypes($returnStatements);
134134

135135
if ($hasImplicitNullReturn) {

0 commit comments

Comments
 (0)