Skip to content

Commit 77ccf64

Browse files
Make ObjectType::equals() compatible PHPStan 2.1.x-dev on DowngradeCovariantReturnTypeRector (#366)
* Make ObjectType::equals() compatible PHPStan 2.1.x-dev on DowngradeCovariantReturnTypeRector * [rector] Rector fixes --------- Co-authored-by: GitHub Action <actions@github.com>
1 parent 1557822 commit 77ccf64

File tree

4 files changed

+3
-6
lines changed

4 files changed

+3
-6
lines changed

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@
88
},
99
"require-dev": {
1010
"phpstan/extension-installer": "^1.4",
11-
"phpstan/phpstan": "^2.1.33",
11+
"phpstan/phpstan": "2.1.x-dev",
1212
"phpstan/phpstan-webmozart-assert": "^2.0",
1313
"phpunit/phpunit": "^11.5",
1414
"rector/jack": "^0.5.1",
15-
"rector/rector-src": "dev-main",
15+
"rector/rector-src": "dev-test-21xdev",
1616
"rector/swiss-knife": "^2.3",
1717
"rector/type-perfect": "^2.1",
1818
"symplify/easy-coding-standard": "^13.0",

rules/DowngradePhp72/NodeManipulator/BitwiseFlagCleaner.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ public function __construct(
2121
public function cleanFuncCall(FuncCall $funcCall, BitwiseOr $bitwiseOr, string $flag, ?Expr $expr = null): void
2222
{
2323
if ($bitwiseOr->left instanceof BitwiseOr) {
24-
/** @var BitwiseOr $leftLeft */
2524
$leftLeft = $bitwiseOr->left;
2625
if ($leftLeft->left instanceof ConstFetch && $this->nodeNameResolver
2726
->isName($leftLeft->left, $flag)) {

rules/DowngradePhp73/Rector/List_/DowngradeListReferenceAssignmentRector.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,6 @@ public function refactor(Node $node): ?array
107107
return null;
108108
}
109109

110-
/** @var Variable $exprVariable */
111110
$exprVariable = $assign->expr;
112111

113112
// Count number of params by ref on the right side, to remove them later on
@@ -210,7 +209,6 @@ private function createAssignRefArrayFromListReferences(
210209
$key = $this->getArrayItemKey($listItem, $position);
211210
// Either the item is a variable, or a nested list
212211
if ($listItem->value instanceof Variable) {
213-
/** @var Variable $itemVariable */
214212
$itemVariable = $listItem->value;
215213
// Remove the reference in the present arrayOrList
216214
$listItem->byRef = false;

rules/DowngradePhp74/Rector/ClassMethod/DowngradeCovariantReturnTypeRector.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ private function resolveMatchingReturnType(
236236
continue;
237237
}
238238

239-
if ($parentReturnType->equals($returnType)) {
239+
if ($returnType->equals($parentReturnType)) {
240240
continue;
241241
}
242242

0 commit comments

Comments
 (0)