From 3e0fbac9374115a27e90b18dbf503fa92551612e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=B6ller?= Date: Tue, 8 Mar 2022 23:00:02 +0100 Subject: [PATCH] Enhancement: Configure single_space_after_construct fixer to enforce a single space after additional constructs --- CHANGELOG.md | 2 ++ src/RuleSet/Php74.php | 1 + src/RuleSet/Php80.php | 1 + src/RuleSet/Php81.php | 3 +++ test/Unit/RuleSet/Php74Test.php | 1 + test/Unit/RuleSet/Php80Test.php | 1 + test/Unit/RuleSet/Php81Test.php | 3 +++ 7 files changed, 12 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a688e814..ed53dab5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ For a full diff see [`4.2.0...main`][4.2.0...main]. - Configured `ordered_class_elements` fixer to order more elements ([#584]), by [@localheinz] - Configured `phpdoc_align` fixer to align more tags ([#586]), by [@localheinz] - Configured `single_class_element_per_statement` fixer to enforce single class element for `const` statements ([#587]), by [@localheinz] +- Configured `single_space_after_construct` fixer to enforce a single space after additional constructs ([#588]), by [@localheinz] ## [`4.2.0`][4.2.0] @@ -611,6 +612,7 @@ For a full diff see [`d899e77...1.0.0`][d899e77...1.0.0]. [#584]: https://github.com/ergebnis/php-cs-fixer-config/pull/584 [#586]: https://github.com/ergebnis/php-cs-fixer-config/pull/586 [#587]: https://github.com/ergebnis/php-cs-fixer-config/pull/587 +[#588]: https://github.com/ergebnis/php-cs-fixer-config/pull/588 [@dependabot]: https://github.com/apps/dependabot [@linuxjuggler]: https://github.com/linuxjuggler diff --git a/src/RuleSet/Php74.php b/src/RuleSet/Php74.php index 1f9fb551..9262d0af 100644 --- a/src/RuleSet/Php74.php +++ b/src/RuleSet/Php74.php @@ -675,6 +675,7 @@ final class Php74 extends AbstractRuleSet implements ExplicitRuleSet 'require_once', 'return', 'static', + 'switch', 'throw', 'trait', 'try', diff --git a/src/RuleSet/Php80.php b/src/RuleSet/Php80.php index 1a099240..ecbc3b3a 100644 --- a/src/RuleSet/Php80.php +++ b/src/RuleSet/Php80.php @@ -675,6 +675,7 @@ final class Php80 extends AbstractRuleSet implements ExplicitRuleSet 'require_once', 'return', 'static', + 'switch', 'throw', 'trait', 'try', diff --git a/src/RuleSet/Php81.php b/src/RuleSet/Php81.php index 1dfd8df6..6e0a7195 100644 --- a/src/RuleSet/Php81.php +++ b/src/RuleSet/Php81.php @@ -645,6 +645,7 @@ final class Php81 extends AbstractRuleSet implements ExplicitRuleSet 'echo', 'else', 'elseif', + 'enum', 'extends', 'final', 'finally', @@ -672,10 +673,12 @@ final class Php81 extends AbstractRuleSet implements ExplicitRuleSet 'private', 'protected', 'public', + 'readonly', 'require', 'require_once', 'return', 'static', + 'switch', 'throw', 'trait', 'try', diff --git a/test/Unit/RuleSet/Php74Test.php b/test/Unit/RuleSet/Php74Test.php index 58a15086..064840ec 100644 --- a/test/Unit/RuleSet/Php74Test.php +++ b/test/Unit/RuleSet/Php74Test.php @@ -681,6 +681,7 @@ final class Php74Test extends ExplicitRuleSetTestCase 'require_once', 'return', 'static', + 'switch', 'throw', 'trait', 'try', diff --git a/test/Unit/RuleSet/Php80Test.php b/test/Unit/RuleSet/Php80Test.php index 83d19462..04f78e40 100644 --- a/test/Unit/RuleSet/Php80Test.php +++ b/test/Unit/RuleSet/Php80Test.php @@ -681,6 +681,7 @@ final class Php80Test extends ExplicitRuleSetTestCase 'require_once', 'return', 'static', + 'switch', 'throw', 'trait', 'try', diff --git a/test/Unit/RuleSet/Php81Test.php b/test/Unit/RuleSet/Php81Test.php index bb45b38d..9a56d7df 100644 --- a/test/Unit/RuleSet/Php81Test.php +++ b/test/Unit/RuleSet/Php81Test.php @@ -651,6 +651,7 @@ final class Php81Test extends ExplicitRuleSetTestCase 'echo', 'else', 'elseif', + 'enum', 'extends', 'final', 'finally', @@ -678,10 +679,12 @@ final class Php81Test extends ExplicitRuleSetTestCase 'private', 'protected', 'public', + 'readonly', 'require', 'require_once', 'return', 'static', + 'switch', 'throw', 'trait', 'try',