[Core] Refactor CreatedByRuleDecorator to only set CREATED_BY_RULE on target Node when class is equals (#2573)

This commit is contained in:
Abdul Malik Ikhsan 2022-06-26 20:48:00 +07:00 committed by GitHub
parent 78d110af4c
commit cf8cbcd4cb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -19,7 +19,9 @@ final class CreatedByRuleDecorator
}
foreach ($node as $singleNode) {
$this->createByRule($singleNode, $rectorClass);
if ($singleNode::class === $originalNode::class) {
$this->createByRule($singleNode, $rectorClass);
}
}
$this->createByRule($originalNode, $rectorClass);