.. _structures-commonalternatives: .. _common-alternatives: Common Alternatives +++++++++++++++++++ In the following conditional structures, expressions were found that are common to both 'then' and 'else'. It may be interesting, though not always possible, to put them both out of the conditional, and reduce line count. may be rewritten in : .. code-block:: php Suggestions ___________ * Collect common expressions, and move them before of after the if/then expression. * Move a prefix and suffixes to a third-party method Specs _____ +--------------+-------------------------------------------------------------------------------------------------------------------------+ | Short name | Structures/CommonAlternatives | +--------------+-------------------------------------------------------------------------------------------------------------------------+ | Rulesets | :ref:`All `, :ref:`Analyze `, :ref:`Changed Behavior ` | +--------------+-------------------------------------------------------------------------------------------------------------------------+ | Exakat since | 0.8.4 | +--------------+-------------------------------------------------------------------------------------------------------------------------+ | PHP Version | All | +--------------+-------------------------------------------------------------------------------------------------------------------------+ | Severity | Major | +--------------+-------------------------------------------------------------------------------------------------------------------------+ | Time To Fix | Instant (5 mins) | +--------------+-------------------------------------------------------------------------------------------------------------------------+ | Precision | Very high | +--------------+-------------------------------------------------------------------------------------------------------------------------+ | Examples | :ref:`case-dolibarr-structures-commonalternatives`, :ref:`case-nextcloud-structures-commonalternatives` | +--------------+-------------------------------------------------------------------------------------------------------------------------+ | Available in | `Entreprise Edition `_, `Exakat Cloud `_ | +--------------+-------------------------------------------------------------------------------------------------------------------------+