Is there any way to say in an abstract class that any implementing classes cannot add extra methods, only define the abstract ones?


I want to propose "final abstract class" as a solution to this: it can be extended, and the abstract methods can be added, but nothing more than that can be done. And the extended class has to be final itself.

Sign in to participate in the conversation
PHP Community on Mastodon

Open source. Open community. We are dedicated to building and enriching the PHP community.