PhpStorm 2019.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 thebody of a function declaration are reported. Since JavaScript blocks do not introduce new scopesas is common in Java and other languages, free-standing block statements may be the result ofcode confusion, and may result in subtle bugs.

Last modified: 20 February 2020