diff --git a/src/Rector/EnforceDisableReturnValueGenerationForTestDoublesRector.php b/src/Rector/EnforceDisableReturnValueGenerationForTestDoublesRector.php index 7fc9380..9a3f0a4 100644 --- a/src/Rector/EnforceDisableReturnValueGenerationForTestDoublesRector.php +++ b/src/Rector/EnforceDisableReturnValueGenerationForTestDoublesRector.php @@ -62,6 +62,10 @@ public function refactor(Node $node): ?Class_ return null; } + if ($node->isAbstract()) { + return null; + } + if ($this->attributeAnalyzer->hasPhpAttribute($node, DisableReturnValueGenerationForTestDoubles::class)) { return null; } diff --git a/tests/rector/Rector/Fixture/abstract_without_attribute.php.inc b/tests/rector/Rector/Fixture/abstract_without_attribute.php.inc new file mode 100644 index 0000000..7b9eb18 --- /dev/null +++ b/tests/rector/Rector/Fixture/abstract_without_attribute.php.inc @@ -0,0 +1,9 @@ +