Skip to content

Latest commit

 

History

History
60 lines (38 loc) · 976 Bytes

empty_loop_body.rst

File metadata and controls

60 lines (38 loc) · 976 Bytes

Rule empty_loop_body

Empty loop-body must be in configured style.

Configuration

style

Style of empty loop-bodies.

Allowed values: 'braces' and 'semicolon'

Default value: 'semicolon'

Examples

Example #1

Default configuration.

--- Original
+++ New
-<?php while(foo()){}
+<?php while(foo());

Example #2

With configuration: ['style' => 'braces'].

--- Original
+++ New
-<?php while(foo());
+<?php while(foo()){}

Rule sets

The rule is part of the following rule sets:

Source class

PhpCsFixer\Fixer\ControlStructure\EmptyLoopBodyFixer