Skip to content
Advertisement

Tag: phpcs

phpcs: How to enforce class inheritance?

I want to make sure all classes in some dir (src/Controller/CP) extend some other class AbstractCPController. So that would show PHPCS error, and would be fine. Is that possible with PHPCS? Answer I ended up creating my own Sniff. Its far from perfect but may serve as a base for somebody in the future:

Advertisement