PhpStorm
 
Get PhpStorm
You are viewing the documentation for an earlier version of PhpStorm.

Code Inspection: Redundant 'if' statement

Last modified: 13 May 2022

Reports an if statement that can be simplified to a single assignment or a return statement.

Example:

After applying the quick-fix the code looks as follows: