Skip to content

Files

Latest commit

 

History

History
29 lines (19 loc) · 613 Bytes

Generic.CodeAnalysis.EmptyStatement.md

File metadata and controls

29 lines (19 loc) · 613 Bytes

Pattern: Empty statement

Issue: -

Description

This rule implements the common algorithm for empty statement body detection. A body is considered as empty if it is completely empty or it only contains whitespace characters and/or comments.

Example

Example of incorrect code:

if ($test) {
    // do nothing
}

Example of correct code:

if ($test) {
    $var = 1;
}

Further Reading