Skip to content

Commit

Permalink
[Core] Refactor CreatedByRuleDecorator to only set CREATED_BY_RULE on…
Browse files Browse the repository at this point in the history
… target Node when class is equals (#2573)
  • Loading branch information
samsonasik committed Jun 26, 2022
1 parent 78d110a commit cf8cbcd
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/NodeDecorator/CreatedByRuleDecorator.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ public function decorate(array | Node $node, Node $originalNode, string $rectorC
}

foreach ($node as $singleNode) {
$this->createByRule($singleNode, $rectorClass);
if ($singleNode::class === $originalNode::class) {
$this->createByRule($singleNode, $rectorClass);
}
}

$this->createByRule($originalNode, $rectorClass);
Expand Down

0 comments on commit cf8cbcd

Please sign in to comment.