PhpStorm 2020.3 Help

Code Inspection: Unnecessary 'block' statement

Reports unnecessary block statements. Block statements that are not used as the body of if , for , while , do , with , or try statements, or as the body of a function declaration are reported. Since JavaScript blocks do not introduce new scopes as is common in Java and other languages, free-standing block statements may be the result of code confusion, and may result in subtle bugs.

Last modified: 08 May 2020