.. _exceptions-uselesstry: .. _useless-try: Useless Try +++++++++++ Report try clause that are useless. A try clause is useless when no `exception `_ is emitted by the code in the block. This happens when the underlying layers removed the emission of exceptions. .. code-block:: php Suggestions ___________ * Remove the Try clause * Add a throw among the different called methods Specs _____ +--------------+-------------------------------------------------------------------------------------------------------------------------+ | Short name | Exceptions/UselessTry | +--------------+-------------------------------------------------------------------------------------------------------------------------+ | 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 `_ | +--------------+-------------------------------------------------------------------------------------------------------------------------+