.. _structures-uselessswitch: .. _useless-switch: Useless Switch ++++++++++++++ This switch has only one case. It may very well be replaced by a ifthen structure. .. code-block:: php Connex PHP features ------------------- + `switch `_ Suggestions ___________ * Turn the switch into a if/then for better readability * Add other cases to the switch, making it adapted to the situation Specs _____ +--------------+-------------------------------------------------------------------------------------------------------------------------+ | Short name | Structures/UselessSwitch | +--------------+-------------------------------------------------------------------------------------------------------------------------+ | 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-phpdocumentor-structures-uselessswitch`, :ref:`case-dolphin-structures-uselessswitch` | +--------------+-------------------------------------------------------------------------------------------------------------------------+ | Available in | `Entreprise Edition `_, `Exakat Cloud `_ | +--------------+-------------------------------------------------------------------------------------------------------------------------+