-
-
Notifications
You must be signed in to change notification settings - Fork 177
Do not mutate function signature of inherited methods #63
Copy link
Copy link
Closed
Description
There is no need to mutate public to protected for methods from the implemented interface.
interface Doable
{
public function do(): void;
}
class Foo implements Doable
{
public function do(): void {}
}Incorrect mutation:
class Foo implements Doable
{
- public function do(): void {}
+ protected function do(): void {}
}Expected result: no mutation, because it always leads to Fatal error: Access level to Foo::do() must be public (as in class Doable)...
At this point, we don't have information about parent classes/interfaces. It requires implementing a new smart feature with native reflection or BetterReflection.
Reactions are currently unavailable