.. _structures-defaultthendiscard: .. _default-then-discard: Default Then Discard ++++++++++++++++++++ Discard the value before assigning it. In the code below, the variable is assigned a default value. Then, this value is immediately tested and discarded. It is more readable to test the value, and discard it, or assign it later, rather than assign first then discard it later. .. code-block:: php Connex PHP features ------------------- + `default `_ Suggestions ___________ * Test the value and bail out if it is not valid before assigning it Specs _____ +--------------+-------------------------------------------------------------------------------------------------------------------------+ | Short name | Structures/DefaultThenDiscard | +--------------+-------------------------------------------------------------------------------------------------------------------------+ | Rulesets | :ref:`All `, :ref:`Analyze `, :ref:`Changed Behavior ` | +--------------+-------------------------------------------------------------------------------------------------------------------------+ | Exakat since | 2.5.3 | +--------------+-------------------------------------------------------------------------------------------------------------------------+ | PHP Version | All | +--------------+-------------------------------------------------------------------------------------------------------------------------+ | Severity | Minor | +--------------+-------------------------------------------------------------------------------------------------------------------------+ | Time To Fix | Quick (30 mins) | +--------------+-------------------------------------------------------------------------------------------------------------------------+ | Precision | Medium | +--------------+-------------------------------------------------------------------------------------------------------------------------+ | Available in | `Entreprise Edition `_, `Exakat Cloud `_ | +--------------+-------------------------------------------------------------------------------------------------------------------------+