Unchecked exceptions settings - how to turn off propagation to inherited exceptions?

In the settings PHP > Analysis I can choose which exceptions are going to be unchecked, like so:

In the above example I added the \Exception class to the list but the problem is that now all exceptions that inherit from the main \Exception class are also treated as unchecked, which effectively means all exceptions become unchecked because they extend \Exception. This makes it useless at all. In the case above I don't care about the base \Exception being thrown and I don't want PHPStorm to alert me about it but I care about all the other exceptions, for which I need the inspection alerts.

Is there any way to set this up the way I want without PHPStorm propagating the settings to all extending exception classes?

 

0

Hello,

Unfortunately, it is not possible to force the IDE not to propagate this setting to child exceptions.
Here is a ticket about it:
https://youtrack.jetbrains.com/issue/WI-44881/Option-to-ignore-subclasses-for-unchecked-exceptions

0

请先登录再写评论。