Fork me on GitHub
a Sensio Labs Product

Jump & Run (v3.28.0) edition

Rule final_public_method_for_abstract_class

All public methods of abstract classes should be final.


Enforce API encapsulation in an inheritance architecture. If you want to override a method, use the Template method pattern.


Using this rule is risky

Risky when overriding public methods of abstract classes.


Example #1

--- Original
+++ New

 abstract class AbstractMachine
-    public function start()
+    final public function start()
The logo is © 2010-2022 Sensio Labs