.. _namespaces-couldusemagicconstant: .. _could-use-namespace-magic-constant: Could Use Namespace Magic Constant ++++++++++++++++++++++++++++++++++ Use the `__NAMESPACE__ `_ magic constant, instead of hardcoding the current namespace. That way, the namespace is easier to read, and it will change with the namespace expression. .. code-block:: php Connex PHP features ------------------- + `magic-constant `_ Suggestions ___________ * Replace the hardcoded namespace with the __NAMESPACE__ constant, and extra separators. Specs _____ +--------------+-------------------------------------------------------------------------------------------------------------------------+ | Short name | Namespaces/CouldUseMagicConstant | +--------------+-------------------------------------------------------------------------------------------------------------------------+ | Rulesets | :ref:`All `, :ref:`Changed Behavior `, :ref:`Suggestions ` | +--------------+-------------------------------------------------------------------------------------------------------------------------+ | Exakat since | 2.5.0 | +--------------+-------------------------------------------------------------------------------------------------------------------------+ | PHP Version | All | +--------------+-------------------------------------------------------------------------------------------------------------------------+ | Severity | Minor | +--------------+-------------------------------------------------------------------------------------------------------------------------+ | Time To Fix | Quick (30 mins) | +--------------+-------------------------------------------------------------------------------------------------------------------------+ | Precision | High | +--------------+-------------------------------------------------------------------------------------------------------------------------+ | Available in | `Entreprise Edition `_, `Exakat Cloud `_ | +--------------+-------------------------------------------------------------------------------------------------------------------------+