Skip to content

Commit

Permalink
Merge pull request #622 from ergebnis/feature/curly-braces-position
Browse files Browse the repository at this point in the history
Enhancement: Enable and configure `curly_braces_position` fixer
  • Loading branch information
localheinz authored Jul 11, 2022
2 parents c725f96 + 3f6fef6 commit 14cfce3
Show file tree
Hide file tree
Showing 7 changed files with 56 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 [`4.4.0...main`][4.4.0...main].

- Updated `friendsofphp/php-cs-fixer` ([#620]), by [@dependabot]
- Enabled `control_structure_braces` fixer ([#621]), by [@localheinz]
- Enabled and configured `curly_braces_position` fixer ([#622]), by [@localheinz]

## [`4.4.0`][4.4.0]

Expand Down Expand Up @@ -641,6 +642,7 @@ For a full diff see [`d899e77...1.0.0`][d899e77...1.0.0].
[#593]: https://github.com/ergebnis/php-cs-fixer-config/pull/593
[#620]: https://github.com/ergebnis/php-cs-fixer-config/pull/620
[#621]: https://github.com/ergebnis/php-cs-fixer-config/pull/621
[#622]: https://github.com/ergebnis/php-cs-fixer-config/pull/622

[@dependabot]: https://github.com/apps/dependabot
[@linuxjuggler]: https://github.com/linuxjuggler
Expand Down
10 changes: 9 additions & 1 deletion src/RuleSet/Php74.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,15 @@ final class Php74 extends AbstractRuleSet implements ExplicitRuleSet
'control_structure_continuation_position' => [
'position' => 'same_line',
],
'curly_braces_position' => false,
'curly_braces_position' => [
'allow_single_line_anonymous_functions' => false,
'allow_single_line_empty_anonymous_classes' => false,
'anonymous_classes_opening_brace' => 'same_line',
'anonymous_functions_opening_brace' => 'same_line',
'classes_opening_brace' => 'next_line_unless_newline_at_signature_end',
'control_structures_opening_brace' => 'same_line',
'functions_opening_brace' => 'next_line_unless_newline_at_signature_end',
],
'date_time_create_from_format_call' => true,
'date_time_immutable' => true,
'declare_equal_normalize' => [
Expand Down
10 changes: 9 additions & 1 deletion src/RuleSet/Php80.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,15 @@ final class Php80 extends AbstractRuleSet implements ExplicitRuleSet
'control_structure_continuation_position' => [
'position' => 'same_line',
],
'curly_braces_position' => false,
'curly_braces_position' => [
'allow_single_line_anonymous_functions' => false,
'allow_single_line_empty_anonymous_classes' => false,
'anonymous_classes_opening_brace' => 'same_line',
'anonymous_functions_opening_brace' => 'same_line',
'classes_opening_brace' => 'next_line_unless_newline_at_signature_end',
'control_structures_opening_brace' => 'same_line',
'functions_opening_brace' => 'next_line_unless_newline_at_signature_end',
],
'date_time_create_from_format_call' => true,
'date_time_immutable' => true,
'declare_equal_normalize' => [
Expand Down
10 changes: 9 additions & 1 deletion src/RuleSet/Php81.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,15 @@ final class Php81 extends AbstractRuleSet implements ExplicitRuleSet
'control_structure_continuation_position' => [
'position' => 'same_line',
],
'curly_braces_position' => false,
'curly_braces_position' => [
'allow_single_line_anonymous_functions' => false,
'allow_single_line_empty_anonymous_classes' => false,
'anonymous_classes_opening_brace' => 'same_line',
'anonymous_functions_opening_brace' => 'same_line',
'classes_opening_brace' => 'next_line_unless_newline_at_signature_end',
'control_structures_opening_brace' => 'same_line',
'functions_opening_brace' => 'next_line_unless_newline_at_signature_end',
],
'date_time_create_from_format_call' => true,
'date_time_immutable' => true,
'declare_equal_normalize' => [
Expand Down
10 changes: 9 additions & 1 deletion test/Unit/RuleSet/Php74Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,15 @@ final class Php74Test extends ExplicitRuleSetTestCase
'control_structure_continuation_position' => [
'position' => 'same_line',
],
'curly_braces_position' => false,
'curly_braces_position' => [
'allow_single_line_anonymous_functions' => false,
'allow_single_line_empty_anonymous_classes' => false,
'anonymous_classes_opening_brace' => 'same_line',
'anonymous_functions_opening_brace' => 'same_line',
'classes_opening_brace' => 'next_line_unless_newline_at_signature_end',
'control_structures_opening_brace' => 'same_line',
'functions_opening_brace' => 'next_line_unless_newline_at_signature_end',
],
'date_time_create_from_format_call' => true,
'date_time_immutable' => true,
'declare_equal_normalize' => [
Expand Down
10 changes: 9 additions & 1 deletion test/Unit/RuleSet/Php80Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,15 @@ final class Php80Test extends ExplicitRuleSetTestCase
'control_structure_continuation_position' => [
'position' => 'same_line',
],
'curly_braces_position' => false,
'curly_braces_position' => [
'allow_single_line_anonymous_functions' => false,
'allow_single_line_empty_anonymous_classes' => false,
'anonymous_classes_opening_brace' => 'same_line',
'anonymous_functions_opening_brace' => 'same_line',
'classes_opening_brace' => 'next_line_unless_newline_at_signature_end',
'control_structures_opening_brace' => 'same_line',
'functions_opening_brace' => 'next_line_unless_newline_at_signature_end',
],
'date_time_create_from_format_call' => true,
'date_time_immutable' => true,
'declare_equal_normalize' => [
Expand Down
10 changes: 9 additions & 1 deletion test/Unit/RuleSet/Php81Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,15 @@ final class Php81Test extends ExplicitRuleSetTestCase
'control_structure_continuation_position' => [
'position' => 'same_line',
],
'curly_braces_position' => false,
'curly_braces_position' => [
'allow_single_line_anonymous_functions' => false,
'allow_single_line_empty_anonymous_classes' => false,
'anonymous_classes_opening_brace' => 'same_line',
'anonymous_functions_opening_brace' => 'same_line',
'classes_opening_brace' => 'next_line_unless_newline_at_signature_end',
'control_structures_opening_brace' => 'same_line',
'functions_opening_brace' => 'next_line_unless_newline_at_signature_end',
],
'date_time_create_from_format_call' => true,
'date_time_immutable' => true,
'declare_equal_normalize' => [
Expand Down

0 comments on commit 14cfce3

Please sign in to comment.