diff --git a/rules/AnnotationsToAttributes/Rector/Class_/AnnotationWithValueToAttributeRector.php b/rules/AnnotationsToAttributes/Rector/Class_/AnnotationWithValueToAttributeRector.php index 422dd761..03e05f02 100644 --- a/rules/AnnotationsToAttributes/Rector/Class_/AnnotationWithValueToAttributeRector.php +++ b/rules/AnnotationsToAttributes/Rector/Class_/AnnotationWithValueToAttributeRector.php @@ -134,7 +134,7 @@ public function refactor(Node $node): ?Node ); if ($node instanceof ClassMethod && $annotationWithValueToAttribute->getIsOnClassLevel() && $this->currentClass instanceof Class_) { - Assert::isInstanceOf($this->currentClass, Class_::class); + Assert::isAOf($this->currentClass, Class_::class); $this->currentClass->attrGroups = array_merge($this->currentClass->attrGroups, [$attributeGroup]); } else { $node->attrGroups = array_merge($node->attrGroups, [$attributeGroup]);