.. _classes-orderofdeclaration: .. _order-of-declaration: Order Of Declaration ++++++++++++++++++++ The order used to declare members and methods has a great impact on readability and maintenance. However, practices varies greatly. As usual, being consistent is the most important and useful. The suggested order is the following : traits, constants, properties, methods. Optional characteristics, like final, `static `_... are not specified. Special methods names are not specified. .. code-block:: php Connex PHP features ------------------- + `class `_ + `anonymous-class `_ + `abstract `_ Suggestions ___________ * Always declare class elements (traits, constants, properties, methods) in the same order. Specs _____ +--------------+--------------------------------------------------------------------------------------------------------------------------------------+ | Short name | Classes/OrderOfDeclaration | +--------------+--------------------------------------------------------------------------------------------------------------------------------------+ | Rulesets | :ref:`All `, :ref:`Changed Behavior `, :ref:`Coding conventions ` | +--------------+--------------------------------------------------------------------------------------------------------------------------------------+ | Exakat since | 0.11.7 | +--------------+--------------------------------------------------------------------------------------------------------------------------------------+ | PHP Version | All | +--------------+--------------------------------------------------------------------------------------------------------------------------------------+ | Severity | | +--------------+--------------------------------------------------------------------------------------------------------------------------------------+ | Time To Fix | | +--------------+--------------------------------------------------------------------------------------------------------------------------------------+ | Precision | Medium | +--------------+--------------------------------------------------------------------------------------------------------------------------------------+ | Available in | `Entreprise Edition `_, `Exakat Cloud `_ | +--------------+--------------------------------------------------------------------------------------------------------------------------------------+