Skip to content

Commit

Permalink
[DX] Remove node connecting travserser from AbstractRector (#4463)
Browse files Browse the repository at this point in the history
  • Loading branch information
TomasVotruba committed Jul 9, 2023
1 parent 9608c7c commit 2ad1b8f
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions src/Rector/AbstractRector.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
use Rector\Core\PhpParser\Node\BetterNodeFinder;
use Rector\Core\PhpParser\Node\NodeFactory;
use Rector\Core\PhpParser\Node\Value\ValueResolver;
use Rector\Core\PhpParser\NodeTraverser\NodeConnectingTraverser;
use Rector\Core\ProcessAnalyzer\RectifiedAnalyzer;
use Rector\Core\Provider\CurrentFileProvider;
use Rector\Core\ValueObject\Application\File;
Expand Down Expand Up @@ -103,8 +102,6 @@ abstract class AbstractRector extends NodeVisitorAbstract implements PhpRectorIn

private FilePathHelper $filePathHelper;

private NodeConnectingTraverser $nodeConnectingTraverser;

private ?string $toBeRemovedNodeHash = null;

#[Required]
Expand All @@ -127,7 +124,6 @@ public function autowire(
ChangedNodeScopeRefresher $changedNodeScopeRefresher,
RectorOutputStyle $rectorOutputStyle,
FilePathHelper $filePathHelper,
NodeConnectingTraverser $nodeConnectingTraverser
): void {
$this->nodeNameResolver = $nodeNameResolver;
$this->nodeTypeResolver = $nodeTypeResolver;
Expand All @@ -147,7 +143,6 @@ public function autowire(
$this->changedNodeScopeRefresher = $changedNodeScopeRefresher;
$this->rectorOutputStyle = $rectorOutputStyle;
$this->filePathHelper = $filePathHelper;
$this->nodeConnectingTraverser = $nodeConnectingTraverser;
}

/**
Expand Down Expand Up @@ -351,7 +346,6 @@ private function postRefactorProcess(Node $originalNode, Node $node, Node|array|
$this->mirrorComments($firstNode, $originalNode);

$this->updateParentNodes($refactoredNode, $parentNode);
$this->nodeConnectingTraverser->traverse($refactoredNode);
$this->refreshScopeNodes($refactoredNode, $filePath, $currentScope);

$this->nodesToReturn[$originalNodeHash] = $refactoredNode;
Expand All @@ -365,7 +359,6 @@ private function postRefactorProcess(Node $originalNode, Node $node, Node|array|
: $refactoredNode;

$this->updateParentNodes($refactoredNode, $parentNode);
$this->nodeConnectingTraverser->traverse([$refactoredNode]);
$this->refreshScopeNodes($refactoredNode, $filePath, $currentScope);

$this->nodesToReturn[$originalNodeHash] = $refactoredNode;
Expand Down

0 comments on commit 2ad1b8f

Please sign in to comment.