From 979db8f49b9ea9426040ee65e6647d431515a8fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=B6ller?= Date: Tue, 8 Mar 2022 11:25:57 +0100 Subject: [PATCH] Enhancement: Configure blank_line_before_statement fixer to include additional statements --- CHANGELOG.md | 5 +++++ src/RuleSet/Php74.php | 3 +++ src/RuleSet/Php80.php | 3 +++ src/RuleSet/Php81.php | 3 +++ test/Unit/RuleSet/Php74Test.php | 3 +++ test/Unit/RuleSet/Php80Test.php | 3 +++ test/Unit/RuleSet/Php81Test.php | 3 +++ 7 files changed, 23 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3782fd08..3daff7a9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), For a full diff see [`4.2.0...main`][4.2.0...main]. +### Changed + +- Configured `blank_line_before_statement` fixer to include additional statements ([#581]), by [@localheinz] + ## [`4.2.0`][4.2.0] For a full diff see [`4.1.0...4.2.0`][4.1.0...4.2.0]. @@ -598,6 +602,7 @@ For a full diff see [`d899e77...1.0.0`][d899e77...1.0.0]. [#578]: https://github.com/ergebnis/php-cs-fixer-config/pull/578 [#579]: https://github.com/ergebnis/php-cs-fixer-config/pull/579 [#580]: https://github.com/ergebnis/php-cs-fixer-config/pull/580 +[#581]: https://github.com/ergebnis/php-cs-fixer-config/pull/581 [@dependabot]: https://github.com/apps/dependabot [@linuxjuggler]: https://github.com/linuxjuggler diff --git a/src/RuleSet/Php74.php b/src/RuleSet/Php74.php index 60389e5d..7317aff4 100644 --- a/src/RuleSet/Php74.php +++ b/src/RuleSet/Php74.php @@ -36,6 +36,7 @@ final class Php74 extends AbstractRuleSet implements ExplicitRuleSet 'blank_line_before_statement' => [ 'statements' => [ 'break', + 'case', 'continue', 'declare', 'default', @@ -47,6 +48,7 @@ final class Php74 extends AbstractRuleSet implements ExplicitRuleSet 'if', 'include', 'include_once', + 'phpdoc', 'require', 'require_once', 'return', @@ -55,6 +57,7 @@ final class Php74 extends AbstractRuleSet implements ExplicitRuleSet 'try', 'while', 'yield', + 'yield_from', ], ], 'braces' => [ diff --git a/src/RuleSet/Php80.php b/src/RuleSet/Php80.php index 975b2da1..73017fce 100644 --- a/src/RuleSet/Php80.php +++ b/src/RuleSet/Php80.php @@ -36,6 +36,7 @@ final class Php80 extends AbstractRuleSet implements ExplicitRuleSet 'blank_line_before_statement' => [ 'statements' => [ 'break', + 'case', 'continue', 'declare', 'default', @@ -47,6 +48,7 @@ final class Php80 extends AbstractRuleSet implements ExplicitRuleSet 'if', 'include', 'include_once', + 'phpdoc', 'require', 'require_once', 'return', @@ -55,6 +57,7 @@ final class Php80 extends AbstractRuleSet implements ExplicitRuleSet 'try', 'while', 'yield', + 'yield_from', ], ], 'braces' => [ diff --git a/src/RuleSet/Php81.php b/src/RuleSet/Php81.php index a11359df..a2508677 100644 --- a/src/RuleSet/Php81.php +++ b/src/RuleSet/Php81.php @@ -36,6 +36,7 @@ final class Php81 extends AbstractRuleSet implements ExplicitRuleSet 'blank_line_before_statement' => [ 'statements' => [ 'break', + 'case', 'continue', 'declare', 'default', @@ -47,6 +48,7 @@ final class Php81 extends AbstractRuleSet implements ExplicitRuleSet 'if', 'include', 'include_once', + 'phpdoc', 'require', 'require_once', 'return', @@ -55,6 +57,7 @@ final class Php81 extends AbstractRuleSet implements ExplicitRuleSet 'try', 'while', 'yield', + 'yield_from', ], ], 'braces' => [ diff --git a/test/Unit/RuleSet/Php74Test.php b/test/Unit/RuleSet/Php74Test.php index 7631b938..4cb11437 100644 --- a/test/Unit/RuleSet/Php74Test.php +++ b/test/Unit/RuleSet/Php74Test.php @@ -42,6 +42,7 @@ final class Php74Test extends ExplicitRuleSetTestCase 'blank_line_before_statement' => [ 'statements' => [ 'break', + 'case', 'continue', 'declare', 'default', @@ -53,6 +54,7 @@ final class Php74Test extends ExplicitRuleSetTestCase 'if', 'include', 'include_once', + 'phpdoc', 'require', 'require_once', 'return', @@ -61,6 +63,7 @@ final class Php74Test extends ExplicitRuleSetTestCase 'try', 'while', 'yield', + 'yield_from', ], ], 'braces' => [ diff --git a/test/Unit/RuleSet/Php80Test.php b/test/Unit/RuleSet/Php80Test.php index 15a71ee4..9d7d0de9 100644 --- a/test/Unit/RuleSet/Php80Test.php +++ b/test/Unit/RuleSet/Php80Test.php @@ -42,6 +42,7 @@ final class Php80Test extends ExplicitRuleSetTestCase 'blank_line_before_statement' => [ 'statements' => [ 'break', + 'case', 'continue', 'declare', 'default', @@ -53,6 +54,7 @@ final class Php80Test extends ExplicitRuleSetTestCase 'if', 'include', 'include_once', + 'phpdoc', 'require', 'require_once', 'return', @@ -61,6 +63,7 @@ final class Php80Test extends ExplicitRuleSetTestCase 'try', 'while', 'yield', + 'yield_from', ], ], 'braces' => [ diff --git a/test/Unit/RuleSet/Php81Test.php b/test/Unit/RuleSet/Php81Test.php index 51fe22ad..4839b744 100644 --- a/test/Unit/RuleSet/Php81Test.php +++ b/test/Unit/RuleSet/Php81Test.php @@ -42,6 +42,7 @@ final class Php81Test extends ExplicitRuleSetTestCase 'blank_line_before_statement' => [ 'statements' => [ 'break', + 'case', 'continue', 'declare', 'default', @@ -53,6 +54,7 @@ final class Php81Test extends ExplicitRuleSetTestCase 'if', 'include', 'include_once', + 'phpdoc', 'require', 'require_once', 'return', @@ -61,6 +63,7 @@ final class Php81Test extends ExplicitRuleSetTestCase 'try', 'while', 'yield', + 'yield_from', ], ], 'braces' => [