Skip to content

Commit

Permalink
Enhancement: Configure braces fixer to allow single-line anonymous cl…
Browse files Browse the repository at this point in the history
…asses with empty body
  • Loading branch information
localheinz committed Dec 22, 2020
1 parent 74dd75c commit b62c8aa
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 6 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ For a full diff see [`2.8.0...main`][2.8.0...main].

* Enabled and configured `php_unit_test_case_static_method_calls` fixer for `Ergebnis\PhpCsFixer\Config\RuleSet\PhpUnit` ([#301]), by [@localheinz]
* Enabled `php_unit_set_up_tear_down_visibility` fixer for `Ergebnis\PhpCsFixer\Config\RuleSet\PhpUnit` ([#303]), by [@localheinz]
* Enabled `allow_single_line_anonymous_class_with_empty_body` option for `braces` fixer ([#306]), by [@localheinz]

### Fixed

Expand Down Expand Up @@ -280,6 +281,7 @@ For a full diff see [`d899e77...1.0.0`][d899e77...1.0.0].
[#301]: https://github.com/ergebnis/php-cs-fixer-config/pull/301
[#303]: https://github.com/ergebnis/php-cs-fixer-config/pull/303
[#304]: https://github.com/ergebnis/php-cs-fixer-config/pull/304
[#306]: https://github.com/ergebnis/php-cs-fixer-config/pull/306

[@dependabot]: https://github.com/apps/dependabot
[@linuxjuggler]: https://github.com/linuxjuggler
Expand Down
4 changes: 3 additions & 1 deletion src/RuleSet/Php71.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@ final class Php71 extends AbstractRuleSet
'yield',
],
],
'braces' => true,
'braces' => [
'allow_single_line_anonymous_class_with_empty_body' => true,
],
'cast_spaces' => true,
'class_attributes_separation' => [
'elements' => [
Expand Down
4 changes: 3 additions & 1 deletion src/RuleSet/Php73.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@ final class Php73 extends AbstractRuleSet
'yield',
],
],
'braces' => true,
'braces' => [
'allow_single_line_anonymous_class_with_empty_body' => true,
],
'cast_spaces' => true,
'class_attributes_separation' => [
'elements' => [
Expand Down
4 changes: 3 additions & 1 deletion src/RuleSet/Php74.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@ final class Php74 extends AbstractRuleSet
'yield',
],
],
'braces' => true,
'braces' => [
'allow_single_line_anonymous_class_with_empty_body' => true,
],
'cast_spaces' => true,
'class_attributes_separation' => [
'elements' => [
Expand Down
4 changes: 3 additions & 1 deletion test/Unit/RuleSet/Php71Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,9 @@ final class Php71Test extends AbstractRuleSetTestCase
'yield',
],
],
'braces' => true,
'braces' => [
'allow_single_line_anonymous_class_with_empty_body' => true,
],
'cast_spaces' => true,
'class_attributes_separation' => [
'elements' => [
Expand Down
4 changes: 3 additions & 1 deletion test/Unit/RuleSet/Php73Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,9 @@ final class Php73Test extends AbstractRuleSetTestCase
'yield',
],
],
'braces' => true,
'braces' => [
'allow_single_line_anonymous_class_with_empty_body' => true,
],
'cast_spaces' => true,
'class_attributes_separation' => [
'elements' => [
Expand Down
4 changes: 3 additions & 1 deletion test/Unit/RuleSet/Php74Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,9 @@ final class Php74Test extends AbstractRuleSetTestCase
'yield',
],
],
'braces' => true,
'braces' => [
'allow_single_line_anonymous_class_with_empty_body' => true,
],
'cast_spaces' => true,
'class_attributes_separation' => [
'elements' => [
Expand Down

0 comments on commit b62c8aa

Please sign in to comment.