Inspectopedia Help

Unnecessary 'else' branch

Reports the else branches in if statements whose bodies always execute a terminating statement such as return or throw. Such branches are redundant and can be safely omitted.

Inspection Details

Available in:

PhpStorm 2023.3, Qodana for PHP 2023.3

Plugin:

PHP, 233.SNAPSHOT

Last modified: 13 July 2023