You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The PrivateInFinalClassRule in PHPStan is currently failing under the following scenario:
When a trait declares an abstract protected method and a final class uses this trait and implements the abstract method, PHPStan issues an error due to the implemented method being protected instead of private. However, I believe that the implemented abstract method should retain the same access modifier, which is protected.
Description
The
PrivateInFinalClassRule
in PHPStan is currently failing under the following scenario:When a trait declares an abstract protected method and a final class uses this trait and implements the abstract method, PHPStan issues an error due to the implemented method being
protected
instead ofprivate
. However, I believe that the implemented abstract method should retain the same access modifier, which isprotected
.Steps to Reproduce
Create a trait with an abstract protected method:
Create a final class that uses the trait and implements the abstract method with a protected access modifier:
Run PHPStan analysis on the above code
Expected Behavior
PHPStan should not issue an error when a final class implements an abstract protected method from a trait.
The text was updated successfully, but these errors were encountered: