Skip to content

Commit c7edd30

Browse files
committed
Updated Rector to commit ed60a2245cfeeefc65e4cfb4e48cabcd839518fe
rectorphp/rector-src@ed60a22 [Alternative][DeadCode][Php80] Handle crash on mix ClassPropertyAssignToConstructorPromotionRector+RemoveParentDelegatingConstructorRector (#7799)
1 parent 796ef4c commit c7edd30

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

src/Application/ChangedNodeScopeRefresher.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,15 @@ public function refresh(Node $node, string $filePath, ?MutatingScope $mutatingSc
6464
$errorMessage = sprintf('Node "%s" with is missing scope required for scope refresh', get_class($node));
6565
throw new ShouldNotHappenException($errorMessage);
6666
}
67-
\Rector\Application\NodeAttributeReIndexer::reIndexNodeAttributes($node);
67+
/**
68+
* The reindex is needed to:
69+
* - be used by PHPStan processNodes() that relies on indexed arrays start from 0
70+
* - use traverser to avoid issues when multiples rules apply, and higher node remove deep node,
71+
* which the next rule use deep node, for example:
72+
* - first rule: - Class_ → ClassMethod → remove stmt with index 0
73+
* - second rule: - ClassMethod → here fetch the index 0 that no longer exists
74+
*/
75+
SimpleCallableNodeTraverser::traverse($node, fn(Node $subNode): ?Node => \Rector\Application\NodeAttributeReIndexer::reIndexNodeAttributes($subNode));
6876
$stmts = $this->resolveStmts($node);
6977
$this->phpStanNodeScopeResolver->processNodes($stmts, $filePath, $mutatingScope);
7078
}

src/Application/VersionResolver.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ final class VersionResolver
1919
* @api
2020
* @var string
2121
*/
22-
public const PACKAGE_VERSION = '3e0bfbf203a4cab3e24126a14ff62b89137fa811';
22+
public const PACKAGE_VERSION = 'ed60a2245cfeeefc65e4cfb4e48cabcd839518fe';
2323
/**
2424
* @api
2525
* @var string
2626
*/
27-
public const RELEASE_DATE = '2026-01-05 14:32:56';
27+
public const RELEASE_DATE = '2026-01-05 15:53:40';
2828
/**
2929
* @var int
3030
*/

0 commit comments

Comments
 (0)