Skip to content

Commit 8888c4e

Browse files
committed
[AnnotationsToAttributes] Apply to class level on @uses on AnnotationWithValueToAttributeRector
1 parent c60c127 commit 8888c4e

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

rules/AnnotationsToAttributes/Rector/Class_/AnnotationWithValueToAttributeRector.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ public function refactor(Node $node): ?Node
133133
[$attributeValue]
134134
);
135135

136-
if ($node instanceof ClassMethod && $annotationWithValueToAttribute->getIsOnClassLevel()) {
136+
if ($node instanceof ClassMethod && $annotationWithValueToAttribute->getIsOnClassLevel() && $this->currentClass instanceof Class_) {
137137
$this->currentClass->attrGroups = array_merge($this->currentClass->attrGroups, [$attributeGroup]);
138138
} else {
139139
$node->attrGroups = array_merge($node->attrGroups, [$attributeGroup]);

0 commit comments

Comments
 (0)