.. _interfaces-inheritedclassconstantvisibility: .. _inherited-class-constant-visibility: Inherited Class Constant Visibility +++++++++++++++++++++++++++++++++++ Visibility of class constant must be public, even when overwritten. This was not checked until PHP 8.3, where it is now a Fatal `Error `_. When the interface and the class are defined in different files, the `error `_ appears at execution time. .. code-block:: php Related PHP errors ------------------- + `Access level to x::I must be public (as in interface i) `_ Connex PHP features ------------------- + `visibility `_ + `lazy-loading `_ Suggestions ___________ * Set the constant visibility in the class to public * Remove the visibility of the constant in the class * Remove the implementation of the interface in the class Specs _____ +--------------+------------------------------------------------------------------------------------------------------------------------------------------+ | Short name | Interfaces/InheritedClassConstantVisibility | +--------------+------------------------------------------------------------------------------------------------------------------------------------------+ | Rulesets | :ref:`All `, :ref:`CompatibilityPHP82 `, :ref:`CompatibilityPHP83 ` | +--------------+------------------------------------------------------------------------------------------------------------------------------------------+ | Exakat since | 2.5.3 | +--------------+------------------------------------------------------------------------------------------------------------------------------------------+ | PHP Version | 8.2 | +--------------+------------------------------------------------------------------------------------------------------------------------------------------+ | Severity | Minor | +--------------+------------------------------------------------------------------------------------------------------------------------------------------+ | Time To Fix | Quick (30 mins) | +--------------+------------------------------------------------------------------------------------------------------------------------------------------+ | Precision | Very high | +--------------+------------------------------------------------------------------------------------------------------------------------------------------+ | Available in | `Entreprise Edition `_, `Exakat Cloud `_ | +--------------+------------------------------------------------------------------------------------------------------------------------------------------+