Catch block empty in PHP Permanently deleted user Created September 30, 2016 08:18 Hi PhpStorm can be configured to detect empty catch blocks in PHP? Kind regards Justo Alonso
Hi,
Yes, it's enabled by default. Inspection is: PHP | Php Inspections (EA Extended) | Control Flow | General '\Exception' is thrown.
Note that Php Inspections (EA Extended) plugin should be installed for this inspection to appear.
Hi.
I installed the plugin and the option is enabled.
Now, all try are marked with warning. The message of warning is:
"Consider moving non-related statements outside the try-block or refactoring try-body into a function/method"
Kind regards
Justo
Hi,
This seems to be "PHP | Php Inspections (EA Extended) | Architecture | Badly organized exception handling" inspection. You can disable it there (and every other EA Extended inspection if you need only to detect empty catch blocks).