.. _classes-couldbeparentmethod: .. _could-be-parent-method: Could Be Parent Method ++++++++++++++++++++++ A method is defined in several children, but not in a the `parent `_ class. It may be worth checking if this method doesn't belong the `parent `_ class, as an abstraction. Only the name of the method is used is for gathering purposes. If the code has grown organically, the signature (default values, typehint, argument names) may have followed different path, and will require a refactorisation. .. code-block:: php +-------------+---------+---------+-----------------------------------------------+ | Name | Default | Type | Description | +-------------+---------+---------+-----------------------------------------------+ | minChildren | 4 | integer | Minimal number of children using this method. | +-------------+---------+---------+-----------------------------------------------+ Connex PHP features ------------------- + `class `_ + `parent `_ Suggestions ___________ * Create an abstract method in the parent * Create an concrete method in the parent, and move default behavior there by removing it in children classes Specs _____ +--------------+--------------------------------------------------------------------------------------------------------------------------+ | Short name | Classes/CouldBeParentMethod | +--------------+--------------------------------------------------------------------------------------------------------------------------+ | Rulesets | :ref:`All `, :ref:`Changed Behavior `, :ref:`Class Review ` | +--------------+--------------------------------------------------------------------------------------------------------------------------+ | Exakat since | 2.1.7 | +--------------+--------------------------------------------------------------------------------------------------------------------------+ | PHP Version | All | +--------------+--------------------------------------------------------------------------------------------------------------------------+ | Severity | Minor | +--------------+--------------------------------------------------------------------------------------------------------------------------+ | Time To Fix | Slow (1 hour) | +--------------+--------------------------------------------------------------------------------------------------------------------------+ | Precision | Very high | +--------------+--------------------------------------------------------------------------------------------------------------------------+ | Available in | `Entreprise Edition `_, `Exakat Cloud `_ | +--------------+--------------------------------------------------------------------------------------------------------------------------+