From f4022dbef12f9ae754fbf4b81da8fe68174d8fd7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=B6ller?= Date: Thu, 13 Oct 2022 11:54:53 +0200 Subject: [PATCH] Enhancement: Enable and configure no_useless_concat_operator fixer --- CHANGELOG.md | 2 ++ src/RuleSet/Php74.php | 4 +++- src/RuleSet/Php80.php | 4 +++- src/RuleSet/Php81.php | 4 +++- test/Unit/RuleSet/Php74Test.php | 4 +++- test/Unit/RuleSet/Php80Test.php | 4 +++- test/Unit/RuleSet/Php81Test.php | 4 +++- 7 files changed, 20 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fafbd3f4..53c519d6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ For a full diff see [`4.9.0...main`][4.9.0...main]. ### Changed - Updated `friendsofphp/php-cs-fixer` ([#661]), by [@dependabot] +- Enabled and configured `no_useless_concat_operator` fixer ([#662]), by [@localheinz] ## [`4.9.0`][4.9.0] @@ -758,6 +759,7 @@ For a full diff see [`d899e77...1.0.0`][d899e77...1.0.0]. [#651]: https://github.com/ergebnis/php-cs-fixer-config/pull/651 [#655]: https://github.com/ergebnis/php-cs-fixer-config/pull/655 [#661]: https://github.com/ergebnis/php-cs-fixer-config/pull/661 +[#662]: https://github.com/ergebnis/php-cs-fixer-config/pull/662 [@dependabot]: https://github.com/apps/dependabot [@linuxjuggler]: https://github.com/linuxjuggler diff --git a/src/RuleSet/Php74.php b/src/RuleSet/Php74.php index f9460035..bb1f1bb0 100644 --- a/src/RuleSet/Php74.php +++ b/src/RuleSet/Php74.php @@ -380,7 +380,9 @@ final class Php74 extends AbstractRuleSet implements ExplicitRuleSet 'no_unset_cast' => true, 'no_unset_on_property' => true, 'no_unused_imports' => true, - 'no_useless_concat_operator' => false, + 'no_useless_concat_operator' => [ + 'juggle_simple_strings' => true, + ], 'no_useless_else' => true, 'no_useless_nullsafe_operator' => false, 'no_useless_return' => true, diff --git a/src/RuleSet/Php80.php b/src/RuleSet/Php80.php index afbbad9d..34eb926b 100644 --- a/src/RuleSet/Php80.php +++ b/src/RuleSet/Php80.php @@ -381,7 +381,9 @@ final class Php80 extends AbstractRuleSet implements ExplicitRuleSet 'no_unset_cast' => true, 'no_unset_on_property' => true, 'no_unused_imports' => true, - 'no_useless_concat_operator' => false, + 'no_useless_concat_operator' => [ + 'juggle_simple_strings' => true, + ], 'no_useless_else' => true, 'no_useless_nullsafe_operator' => true, 'no_useless_return' => true, diff --git a/src/RuleSet/Php81.php b/src/RuleSet/Php81.php index ca65267c..ffc541bb 100644 --- a/src/RuleSet/Php81.php +++ b/src/RuleSet/Php81.php @@ -381,7 +381,9 @@ final class Php81 extends AbstractRuleSet implements ExplicitRuleSet 'no_unset_cast' => true, 'no_unset_on_property' => true, 'no_unused_imports' => true, - 'no_useless_concat_operator' => false, + 'no_useless_concat_operator' => [ + 'juggle_simple_strings' => true, + ], 'no_useless_else' => true, 'no_useless_nullsafe_operator' => true, 'no_useless_return' => true, diff --git a/test/Unit/RuleSet/Php74Test.php b/test/Unit/RuleSet/Php74Test.php index 76468f48..29b55e89 100644 --- a/test/Unit/RuleSet/Php74Test.php +++ b/test/Unit/RuleSet/Php74Test.php @@ -386,7 +386,9 @@ final class Php74Test extends ExplicitRuleSetTestCase 'no_unset_cast' => true, 'no_unset_on_property' => true, 'no_unused_imports' => true, - 'no_useless_concat_operator' => false, + 'no_useless_concat_operator' => [ + 'juggle_simple_strings' => true, + ], 'no_useless_else' => true, 'no_useless_nullsafe_operator' => false, 'no_useless_return' => true, diff --git a/test/Unit/RuleSet/Php80Test.php b/test/Unit/RuleSet/Php80Test.php index c0ae2ba8..9693ce08 100644 --- a/test/Unit/RuleSet/Php80Test.php +++ b/test/Unit/RuleSet/Php80Test.php @@ -387,7 +387,9 @@ final class Php80Test extends ExplicitRuleSetTestCase 'no_unset_cast' => true, 'no_unset_on_property' => true, 'no_unused_imports' => true, - 'no_useless_concat_operator' => false, + 'no_useless_concat_operator' => [ + 'juggle_simple_strings' => true, + ], 'no_useless_else' => true, 'no_useless_nullsafe_operator' => true, 'no_useless_return' => true, diff --git a/test/Unit/RuleSet/Php81Test.php b/test/Unit/RuleSet/Php81Test.php index b62ad9c7..96127336 100644 --- a/test/Unit/RuleSet/Php81Test.php +++ b/test/Unit/RuleSet/Php81Test.php @@ -387,7 +387,9 @@ final class Php81Test extends ExplicitRuleSetTestCase 'no_unset_cast' => true, 'no_unset_on_property' => true, 'no_unused_imports' => true, - 'no_useless_concat_operator' => false, + 'no_useless_concat_operator' => [ + 'juggle_simple_strings' => true, + ], 'no_useless_else' => true, 'no_useless_nullsafe_operator' => true, 'no_useless_return' => true,