From 450aea6d7270ac8962b57c38af902f67af344ddc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=B6ller?= Date: Tue, 5 Oct 2021 19:10:15 +0200 Subject: [PATCH] Enhancement: Enable and configure empty_loop_condition fixer --- CHANGELOG.md | 2 ++ src/RuleSet/Php73.php | 4 +++- src/RuleSet/Php74.php | 4 +++- src/RuleSet/Php80.php | 4 +++- test/Unit/RuleSet/Php73Test.php | 4 +++- test/Unit/RuleSet/Php74Test.php | 4 +++- test/Unit/RuleSet/Php80Test.php | 4 +++- 7 files changed, 20 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0b108488..2af07f07 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ For a full diff see [`3.0.2...main`][3.0.2...main]. * Updated `friendsofphp/php-cs-fixer` ([#495]), by [@dependabot] * Enabled `assign_null_coalescing_to_coalesce_equal` fixer in `Php74` and `Php80` rule sets ([#497]), by [@localheinz] * Enabled and configured `control_structure_continuation_position` fixer ([#498]), by [@localheinz] +* Enabled and configured `empty_loop_condition` fixer ([#499]), by [@localheinz] ### Fixed @@ -500,6 +501,7 @@ For a full diff see [`d899e77...1.0.0`][d899e77...1.0.0]. [#496]: https://github.com/ergebnis/php-cs-fixer-config/pull/496 [#497]: https://github.com/ergebnis/php-cs-fixer-config/pull/497 [#498]: https://github.com/ergebnis/php-cs-fixer-config/pull/498 +[#499]: https://github.com/ergebnis/php-cs-fixer-config/pull/499 [@dependabot]: https://github.com/apps/dependabot [@linuxjuggler]: https://github.com/linuxjuggler diff --git a/src/RuleSet/Php73.php b/src/RuleSet/Php73.php index 6a8f338a..32d4a4d9 100644 --- a/src/RuleSet/Php73.php +++ b/src/RuleSet/Php73.php @@ -137,7 +137,9 @@ final class Php73 extends AbstractRuleSet implements ExplicitRuleSet 'empty_loop_body' => [ 'style' => 'braces', ], - 'empty_loop_condition' => false, + 'empty_loop_condition' => [ + 'style' => 'while', + ], 'encoding' => true, 'ereg_to_preg' => true, 'error_suppression' => [ diff --git a/src/RuleSet/Php74.php b/src/RuleSet/Php74.php index d7687451..6ad86bd5 100644 --- a/src/RuleSet/Php74.php +++ b/src/RuleSet/Php74.php @@ -137,7 +137,9 @@ final class Php74 extends AbstractRuleSet implements ExplicitRuleSet 'empty_loop_body' => [ 'style' => 'braces', ], - 'empty_loop_condition' => false, + 'empty_loop_condition' => [ + 'style' => 'while', + ], 'encoding' => true, 'ereg_to_preg' => true, 'error_suppression' => [ diff --git a/src/RuleSet/Php80.php b/src/RuleSet/Php80.php index b828a2b8..6aabd02b 100644 --- a/src/RuleSet/Php80.php +++ b/src/RuleSet/Php80.php @@ -137,7 +137,9 @@ final class Php80 extends AbstractRuleSet implements ExplicitRuleSet 'empty_loop_body' => [ 'style' => 'braces', ], - 'empty_loop_condition' => false, + 'empty_loop_condition' => [ + 'style' => 'while', + ], 'encoding' => true, 'ereg_to_preg' => true, 'error_suppression' => [ diff --git a/test/Unit/RuleSet/Php73Test.php b/test/Unit/RuleSet/Php73Test.php index 78d8bfe2..fee6a21a 100644 --- a/test/Unit/RuleSet/Php73Test.php +++ b/test/Unit/RuleSet/Php73Test.php @@ -143,7 +143,9 @@ final class Php73Test extends ExplicitRuleSetTestCase 'empty_loop_body' => [ 'style' => 'braces', ], - 'empty_loop_condition' => false, + 'empty_loop_condition' => [ + 'style' => 'while', + ], 'encoding' => true, 'ereg_to_preg' => true, 'error_suppression' => [ diff --git a/test/Unit/RuleSet/Php74Test.php b/test/Unit/RuleSet/Php74Test.php index 513e8125..aad0f084 100644 --- a/test/Unit/RuleSet/Php74Test.php +++ b/test/Unit/RuleSet/Php74Test.php @@ -143,7 +143,9 @@ final class Php74Test extends ExplicitRuleSetTestCase 'empty_loop_body' => [ 'style' => 'braces', ], - 'empty_loop_condition' => false, + 'empty_loop_condition' => [ + 'style' => 'while', + ], 'encoding' => true, 'ereg_to_preg' => true, 'error_suppression' => [ diff --git a/test/Unit/RuleSet/Php80Test.php b/test/Unit/RuleSet/Php80Test.php index 5ca6a93e..7312c731 100644 --- a/test/Unit/RuleSet/Php80Test.php +++ b/test/Unit/RuleSet/Php80Test.php @@ -143,7 +143,9 @@ final class Php80Test extends ExplicitRuleSetTestCase 'empty_loop_body' => [ 'style' => 'braces', ], - 'empty_loop_condition' => false, + 'empty_loop_condition' => [ + 'style' => 'while', + ], 'encoding' => true, 'ereg_to_preg' => true, 'error_suppression' => [