Fork me on GitHub
a Sensio Labs Product

Jump & Run (v3.28.0) edition

Rule empty_loop_body

Empty loop-body must be in configured style.



Style of empty loop-bodies.

Allowed values: 'braces' and 'semicolon'

Default value: 'semicolon'


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:

The logo is © 2010-2022 Sensio Labs