Skip to content

Commit

Permalink
Updated Rector to commit ebfb78242931b03c082ce5b2f018b84c6742373f
Browse files Browse the repository at this point in the history
rectorphp/rector-src@ebfb782 Reduce double loop to set stmt_key on refresh process (#6619)
  • Loading branch information
TomasVotruba committed Dec 20, 2024
1 parent 79fb8fc commit e5dd70b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
4 changes: 3 additions & 1 deletion src/Application/ChangedNodeScopeRefresher.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@ public function refresh(Node $node, string $filePath, ?MutatingScope $mutatingSc
$errorMessage = \sprintf('Node "%s" with is missing scope required for scope refresh', \get_class($node));
throw new ShouldNotHappenException($errorMessage);
}
\Rector\Application\NodeAttributeReIndexer::reIndexNodeAttributes($node);
// reindex stmt_key already covered on StmtKeyNodeVisitor on next processNodes()
// so set flag $reIndexStmtKey to false to avoid double loop
\Rector\Application\NodeAttributeReIndexer::reIndexNodeAttributes($node, \false);
$stmts = $this->resolveStmts($node);
$this->phpStanNodeScopeResolver->processNodes($stmts, $filePath, $mutatingScope);
}
Expand Down
6 changes: 4 additions & 2 deletions src/Application/NodeAttributeReIndexer.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,11 @@ public static function reIndexStmtKeyNodeAttributes(Node $node) : ?Node
}
return $node;
}
public static function reIndexNodeAttributes(Node $node) : ?Node
public static function reIndexNodeAttributes(Node $node, bool $reIndexStmtKey = \true) : ?Node
{
self::reIndexStmtKeyNodeAttributes($node);
if ($reIndexStmtKey) {
self::reIndexStmtKeyNodeAttributes($node);
}
if ($node instanceof If_) {
$node->elseifs = \array_values($node->elseifs);
return $node;
Expand Down
4 changes: 2 additions & 2 deletions src/Application/VersionResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ final class VersionResolver
* @api
* @var string
*/
public const PACKAGE_VERSION = 'a72a02188ab22b7beeb94dd1ffda79bdfffd64c4';
public const PACKAGE_VERSION = 'ebfb78242931b03c082ce5b2f018b84c6742373f';
/**
* @api
* @var string
*/
public const RELEASE_DATE = '2024-12-20 07:14:41';
public const RELEASE_DATE = '2024-12-20 12:45:44';
/**
* @var int
*/
Expand Down

0 comments on commit e5dd70b

Please sign in to comment.