Fix whitespace after a semicolon.
Whether spaces should be removed for empty for
expressions.
Allowed types: bool
Default value: false
Default configuration.
--- Original
+++ New
<?php
- sample(); $test = 1;
- sample();$test = 2;
- for ( ;;++$sample) {
+ sample(); $test = 1;
+ sample(); $test = 2;
+ for ( ; ; ++$sample) {
}
With configuration: ['remove_in_empty_for_expressions' => true]
.
--- Original
+++ New
<?php
-for ($i = 0; ; ++$i) {
+for ($i = 0;; ++$i) {
}
The rule is part of the following rule sets:
@PhpCsFixer with config:
['remove_in_empty_for_expressions' => true]
@Symfony with config:
['remove_in_empty_for_expressions' => true]
- Fixer class: PhpCsFixer\Fixer\Semicolon\SpaceAfterSemicolonFixer
- Test class: PhpCsFixer\Tests\Fixer\Semicolon\SpaceAfterSemicolonFixerTest
The test class defines officially supported behaviour. Each test case is a part of our backward compatibility promise.