-
-
Notifications
You must be signed in to change notification settings - Fork 409
[DeadCode] Skip abstract method on RemoveUnusedPublicMethodParameterRector #7002
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
||
namespace Rector\Tests\DeadCode\Rector\ClassMethod\RemoveUnusedPublicMethodParameterRector\FixtureTreatClassesAsFinal; | ||
|
||
abstract class SkipAbstractMethod |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@TomasVotruba abstract method
only exists in abstract class
, this means in other rules, the check $class->isAbstract()
is needed as well, since abstract never be "final".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will create separate PR for add is abstract check on "treat final class" since abstract never be "final"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I created separate PR for always verify class is abstract before FeatureFlags::treatClassesAsFinal()
check at PR:
public static function reset(): void | ||
{ | ||
SimpleParameterProvider::setParameter(Option::TREAT_CLASSES_AS_FINAL, false); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just moved this reset functionality to AbstractRectorTestCase::tearDownAfterClass
All checks have passed 🎉 @TomasVotruba I am merging it ;) |
It happen when
->withTreatClassesAsFinal();
is used, which non-final class can have abstract method to be implemented by child.