.. _classes-mismatchproperties: .. _mismatch-properties-typehints: Mismatch Properties Typehints +++++++++++++++++++++++++++++ Properties must match within the same family. When a property is declared both in a `parent `_ class, and a child class, they must have the same type. The same type includes a possible null value. This doesn't apply to private properties, which are only visible locally. This code will lint, but not execute. .. code-block:: php Related PHP errors ------------------- + `0 `_ Connex PHP features ------------------- + `property `_ Suggestions ___________ * Remove some of the property declarations, and only keep it in the highest ranking parent * Match the typehints of the property declarations * Make the properties private * Remove the child class (or the parent class) Specs _____ +--------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Short name | Classes/MismatchProperties | +--------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Rulesets | :ref:`All `, :ref:`Analyze `, :ref:`Changed Behavior `, :ref:`Class Review `, :ref:`LintButWontExec ` | +--------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Exakat since | 2.1.4 | +--------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | PHP Version | All | +--------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Severity | Minor | +--------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Time To Fix | Quick (30 mins) | +--------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Precision | High | +--------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Note | This issue may lint but will not run | +--------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Available in | `Entreprise Edition `_, `Exakat Cloud `_ | +--------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+