Skip to content

Commit

Permalink
Merge pull request #976 from ergebnis/feature/no-duplicated-array-key…
Browse files Browse the repository at this point in the history
…-fixer

Enhancement: Enable and configure `PhpCsFixerCustomFixers/no_duplicated_array_key` fixer
  • Loading branch information
localheinz authored Jan 4, 2024
2 parents 66f2a39 + 9a60c7d commit 8f35865
Show file tree
Hide file tree
Showing 27 changed files with 106 additions and 0 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 [`6.18.0...main`][6.18.0...main].

- Enabled the `PhpCsFixerCustomFixers/multiline_comment_opening_closing_alone` fixer ([#974]), by [@localheinz]
- Enabled the `PhpCsFixerCustomFixers/multiline_promoted_properties` fixer ([#975]), by [@localheinz]
- Enabled the `PhpCsFixerCustomFixers/no_duplicated_array_key` fixer ([#976]), by [@localheinz]

## [`6.18.0`][6.18.0]

Expand Down Expand Up @@ -1486,6 +1487,7 @@ For a full diff see [`d899e77...1.0.0`][d899e77...1.0.0].
[#973]: https://github.com/ergebnis/php-cs-fixer-config/pull/973
[#974]: https://github.com/ergebnis/php-cs-fixer-config/pull/974
[#975]: https://github.com/ergebnis/php-cs-fixer-config/pull/975
[#976]: https://github.com/ergebnis/php-cs-fixer-config/pull/976

[@dependabot]: https://github.com/apps/dependabot
[@linuxjuggler]: https://github.com/linuxjuggler
Expand Down
4 changes: 4 additions & 0 deletions src/RuleSet/Php53.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ public static function create(): RuleSet
return RuleSet::create(
Fixers::fromFixers(
new Fixer\MultilineCommentOpeningClosingAloneFixer(),
new Fixer\NoDuplicatedArrayKeyFixer(),
new Fixer\PhpdocArrayStyleFixer(),
new Fixer\PhpdocTypeListFixer(),
new PhpCsFixer\Whitespace\LineBreakAfterStatementsFixer(),
Expand All @@ -47,6 +48,9 @@ public static function create(): RuleSet
Rules::fromArray([
'ErickSkrauch/line_break_after_statements' => true,
'PhpCsFixerCustomFixers/multiline_comment_opening_closing_alone' => true,
'PhpCsFixerCustomFixers/no_duplicated_array_key' => [
'ignore_expressions' => true,
],
'PhpCsFixerCustomFixers/phpdoc_array_style' => true,
'PhpCsFixerCustomFixers/phpdoc_type_list' => true,
'align_multiline_comment' => [
Expand Down
4 changes: 4 additions & 0 deletions src/RuleSet/Php54.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ public static function create(): RuleSet
return RuleSet::create(
Fixers::fromFixers(
new Fixer\MultilineCommentOpeningClosingAloneFixer(),
new Fixer\NoDuplicatedArrayKeyFixer(),
new Fixer\PhpdocArrayStyleFixer(),
new Fixer\PhpdocTypeListFixer(),
new PhpCsFixer\Whitespace\LineBreakAfterStatementsFixer(),
Expand All @@ -47,6 +48,9 @@ public static function create(): RuleSet
Rules::fromArray([
'ErickSkrauch/line_break_after_statements' => true,
'PhpCsFixerCustomFixers/multiline_comment_opening_closing_alone' => true,
'PhpCsFixerCustomFixers/no_duplicated_array_key' => [
'ignore_expressions' => true,
],
'PhpCsFixerCustomFixers/phpdoc_array_style' => true,
'PhpCsFixerCustomFixers/phpdoc_type_list' => true,
'align_multiline_comment' => [
Expand Down
4 changes: 4 additions & 0 deletions src/RuleSet/Php55.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ public static function create(): RuleSet
return RuleSet::create(
Fixers::fromFixers(
new Fixer\MultilineCommentOpeningClosingAloneFixer(),
new Fixer\NoDuplicatedArrayKeyFixer(),
new Fixer\PhpdocArrayStyleFixer(),
new Fixer\PhpdocTypeListFixer(),
new PhpCsFixer\Whitespace\LineBreakAfterStatementsFixer(),
Expand All @@ -47,6 +48,9 @@ public static function create(): RuleSet
Rules::fromArray([
'ErickSkrauch/line_break_after_statements' => true,
'PhpCsFixerCustomFixers/multiline_comment_opening_closing_alone' => true,
'PhpCsFixerCustomFixers/no_duplicated_array_key' => [
'ignore_expressions' => true,
],
'PhpCsFixerCustomFixers/phpdoc_array_style' => true,
'PhpCsFixerCustomFixers/phpdoc_type_list' => true,
'align_multiline_comment' => [
Expand Down
4 changes: 4 additions & 0 deletions src/RuleSet/Php56.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ public static function create(): RuleSet
return RuleSet::create(
Fixers::fromFixers(
new Fixer\MultilineCommentOpeningClosingAloneFixer(),
new Fixer\NoDuplicatedArrayKeyFixer(),
new Fixer\PhpdocArrayStyleFixer(),
new Fixer\PhpdocTypeListFixer(),
new PhpCsFixer\Whitespace\LineBreakAfterStatementsFixer(),
Expand All @@ -47,6 +48,9 @@ public static function create(): RuleSet
Rules::fromArray([
'ErickSkrauch/line_break_after_statements' => true,
'PhpCsFixerCustomFixers/multiline_comment_opening_closing_alone' => true,
'PhpCsFixerCustomFixers/no_duplicated_array_key' => [
'ignore_expressions' => true,
],
'PhpCsFixerCustomFixers/phpdoc_array_style' => true,
'PhpCsFixerCustomFixers/phpdoc_type_list' => true,
'align_multiline_comment' => [
Expand Down
4 changes: 4 additions & 0 deletions src/RuleSet/Php70.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ public static function create(): RuleSet
return RuleSet::create(
Fixers::fromFixers(
new Fixer\MultilineCommentOpeningClosingAloneFixer(),
new Fixer\NoDuplicatedArrayKeyFixer(),
new Fixer\PhpdocArrayStyleFixer(),
new Fixer\PhpdocTypeListFixer(),
new PhpCsFixer\Whitespace\LineBreakAfterStatementsFixer(),
Expand All @@ -47,6 +48,9 @@ public static function create(): RuleSet
Rules::fromArray([
'ErickSkrauch/line_break_after_statements' => true,
'PhpCsFixerCustomFixers/multiline_comment_opening_closing_alone' => true,
'PhpCsFixerCustomFixers/no_duplicated_array_key' => [
'ignore_expressions' => true,
],
'PhpCsFixerCustomFixers/phpdoc_array_style' => true,
'PhpCsFixerCustomFixers/phpdoc_type_list' => true,
'align_multiline_comment' => [
Expand Down
4 changes: 4 additions & 0 deletions src/RuleSet/Php71.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ public static function create(): RuleSet
return RuleSet::create(
Fixers::fromFixers(
new Fixer\MultilineCommentOpeningClosingAloneFixer(),
new Fixer\NoDuplicatedArrayKeyFixer(),
new Fixer\PhpdocArrayStyleFixer(),
new Fixer\PhpdocTypeListFixer(),
new PhpCsFixer\Whitespace\LineBreakAfterStatementsFixer(),
Expand All @@ -47,6 +48,9 @@ public static function create(): RuleSet
Rules::fromArray([
'ErickSkrauch/line_break_after_statements' => true,
'PhpCsFixerCustomFixers/multiline_comment_opening_closing_alone' => true,
'PhpCsFixerCustomFixers/no_duplicated_array_key' => [
'ignore_expressions' => true,
],
'PhpCsFixerCustomFixers/phpdoc_array_style' => true,
'PhpCsFixerCustomFixers/phpdoc_type_list' => true,
'align_multiline_comment' => [
Expand Down
4 changes: 4 additions & 0 deletions src/RuleSet/Php72.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ public static function create(): RuleSet
return RuleSet::create(
Fixers::fromFixers(
new Fixer\MultilineCommentOpeningClosingAloneFixer(),
new Fixer\NoDuplicatedArrayKeyFixer(),
new Fixer\PhpdocArrayStyleFixer(),
new Fixer\PhpdocTypeListFixer(),
new PhpCsFixer\Whitespace\LineBreakAfterStatementsFixer(),
Expand All @@ -47,6 +48,9 @@ public static function create(): RuleSet
Rules::fromArray([
'ErickSkrauch/line_break_after_statements' => true,
'PhpCsFixerCustomFixers/multiline_comment_opening_closing_alone' => true,
'PhpCsFixerCustomFixers/no_duplicated_array_key' => [
'ignore_expressions' => true,
],
'PhpCsFixerCustomFixers/phpdoc_array_style' => true,
'PhpCsFixerCustomFixers/phpdoc_type_list' => true,
'align_multiline_comment' => [
Expand Down
4 changes: 4 additions & 0 deletions src/RuleSet/Php73.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ public static function create(): RuleSet
return RuleSet::create(
Fixers::fromFixers(
new Fixer\MultilineCommentOpeningClosingAloneFixer(),
new Fixer\NoDuplicatedArrayKeyFixer(),
new Fixer\PhpdocArrayStyleFixer(),
new Fixer\PhpdocTypeListFixer(),
new PhpCsFixer\Whitespace\LineBreakAfterStatementsFixer(),
Expand All @@ -47,6 +48,9 @@ public static function create(): RuleSet
Rules::fromArray([
'ErickSkrauch/line_break_after_statements' => true,
'PhpCsFixerCustomFixers/multiline_comment_opening_closing_alone' => true,
'PhpCsFixerCustomFixers/no_duplicated_array_key' => [
'ignore_expressions' => true,
],
'PhpCsFixerCustomFixers/phpdoc_array_style' => true,
'PhpCsFixerCustomFixers/phpdoc_type_list' => true,
'align_multiline_comment' => [
Expand Down
4 changes: 4 additions & 0 deletions src/RuleSet/Php74.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ public static function create(): RuleSet
return RuleSet::create(
Fixers::fromFixers(
new Fixer\MultilineCommentOpeningClosingAloneFixer(),
new Fixer\NoDuplicatedArrayKeyFixer(),
new Fixer\PhpdocArrayStyleFixer(),
new Fixer\PhpdocTypeListFixer(),
new PhpCsFixer\Whitespace\LineBreakAfterStatementsFixer(),
Expand All @@ -47,6 +48,9 @@ public static function create(): RuleSet
Rules::fromArray([
'ErickSkrauch/line_break_after_statements' => true,
'PhpCsFixerCustomFixers/multiline_comment_opening_closing_alone' => true,
'PhpCsFixerCustomFixers/no_duplicated_array_key' => [
'ignore_expressions' => true,
],
'PhpCsFixerCustomFixers/phpdoc_array_style' => true,
'PhpCsFixerCustomFixers/phpdoc_type_list' => true,
'align_multiline_comment' => [
Expand Down
4 changes: 4 additions & 0 deletions src/RuleSet/Php80.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ public static function create(): RuleSet
Fixers::fromFixers(
new Fixer\MultilineCommentOpeningClosingAloneFixer(),
new Fixer\MultilinePromotedPropertiesFixer(),
new Fixer\NoDuplicatedArrayKeyFixer(),
new Fixer\PhpdocArrayStyleFixer(),
new Fixer\PhpdocTypeListFixer(),
new PhpCsFixer\Whitespace\LineBreakAfterStatementsFixer(),
Expand All @@ -52,6 +53,9 @@ public static function create(): RuleSet
'keep_blank_lines' => false,
'minimum_number_of_parameters' => 2,
],
'PhpCsFixerCustomFixers/no_duplicated_array_key' => [
'ignore_expressions' => true,
],
'PhpCsFixerCustomFixers/phpdoc_array_style' => true,
'PhpCsFixerCustomFixers/phpdoc_type_list' => true,
'align_multiline_comment' => [
Expand Down
4 changes: 4 additions & 0 deletions src/RuleSet/Php81.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ public static function create(): RuleSet
Fixers::fromFixers(
new Fixer\MultilineCommentOpeningClosingAloneFixer(),
new Fixer\MultilinePromotedPropertiesFixer(),
new Fixer\NoDuplicatedArrayKeyFixer(),
new Fixer\PhpdocArrayStyleFixer(),
new Fixer\PhpdocTypeListFixer(),
new PhpCsFixer\Whitespace\LineBreakAfterStatementsFixer(),
Expand All @@ -52,6 +53,9 @@ public static function create(): RuleSet
'keep_blank_lines' => false,
'minimum_number_of_parameters' => 2,
],
'PhpCsFixerCustomFixers/no_duplicated_array_key' => [
'ignore_expressions' => true,
],
'PhpCsFixerCustomFixers/phpdoc_array_style' => true,
'PhpCsFixerCustomFixers/phpdoc_type_list' => true,
'align_multiline_comment' => [
Expand Down
4 changes: 4 additions & 0 deletions src/RuleSet/Php82.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ public static function create(): RuleSet
Fixers::fromFixers(
new Fixer\MultilineCommentOpeningClosingAloneFixer(),
new Fixer\MultilinePromotedPropertiesFixer(),
new Fixer\NoDuplicatedArrayKeyFixer(),
new Fixer\PhpdocArrayStyleFixer(),
new Fixer\PhpdocTypeListFixer(),
new PhpCsFixer\Whitespace\LineBreakAfterStatementsFixer(),
Expand All @@ -52,6 +53,9 @@ public static function create(): RuleSet
'keep_blank_lines' => false,
'minimum_number_of_parameters' => 2,
],
'PhpCsFixerCustomFixers/no_duplicated_array_key' => [
'ignore_expressions' => true,
],
'PhpCsFixerCustomFixers/phpdoc_array_style' => true,
'PhpCsFixerCustomFixers/phpdoc_type_list' => true,
'align_multiline_comment' => [
Expand Down
4 changes: 4 additions & 0 deletions src/RuleSet/Php83.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ public static function create(): RuleSet
Fixers::fromFixers(
new Fixer\MultilineCommentOpeningClosingAloneFixer(),
new Fixer\MultilinePromotedPropertiesFixer(),
new Fixer\NoDuplicatedArrayKeyFixer(),
new Fixer\PhpdocArrayStyleFixer(),
new Fixer\PhpdocTypeListFixer(),
new PhpCsFixer\Whitespace\LineBreakAfterStatementsFixer(),
Expand All @@ -52,6 +53,9 @@ public static function create(): RuleSet
'keep_blank_lines' => false,
'minimum_number_of_parameters' => 2,
],
'PhpCsFixerCustomFixers/no_duplicated_array_key' => [
'ignore_expressions' => true,
],
'PhpCsFixerCustomFixers/phpdoc_array_style' => true,
'PhpCsFixerCustomFixers/phpdoc_type_list' => true,
'align_multiline_comment' => [
Expand Down
4 changes: 4 additions & 0 deletions test/Unit/RuleSet/Php53Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ protected function expectedCustomFixers(): Fixers
{
return Fixers::fromFixers(
new Fixer\MultilineCommentOpeningClosingAloneFixer(),
new Fixer\NoDuplicatedArrayKeyFixer(),
new Fixer\PhpdocArrayStyleFixer(),
new Fixer\PhpdocTypeListFixer(),
new PhpCsFixer\Whitespace\LineBreakAfterStatementsFixer(),
Expand All @@ -70,6 +71,9 @@ protected function expectedRules(): Rules
return Rules::fromArray([
'ErickSkrauch/line_break_after_statements' => true,
'PhpCsFixerCustomFixers/multiline_comment_opening_closing_alone' => true,
'PhpCsFixerCustomFixers/no_duplicated_array_key' => [
'ignore_expressions' => true,
],
'PhpCsFixerCustomFixers/phpdoc_array_style' => true,
'PhpCsFixerCustomFixers/phpdoc_type_list' => true,
'align_multiline_comment' => [
Expand Down
4 changes: 4 additions & 0 deletions test/Unit/RuleSet/Php54Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ protected function expectedCustomFixers(): Fixers
{
return Fixers::fromFixers(
new Fixer\MultilineCommentOpeningClosingAloneFixer(),
new Fixer\NoDuplicatedArrayKeyFixer(),
new Fixer\PhpdocArrayStyleFixer(),
new Fixer\PhpdocTypeListFixer(),
new PhpCsFixer\Whitespace\LineBreakAfterStatementsFixer(),
Expand All @@ -70,6 +71,9 @@ protected function expectedRules(): Rules
return Rules::fromArray([
'ErickSkrauch/line_break_after_statements' => true,
'PhpCsFixerCustomFixers/multiline_comment_opening_closing_alone' => true,
'PhpCsFixerCustomFixers/no_duplicated_array_key' => [
'ignore_expressions' => true,
],
'PhpCsFixerCustomFixers/phpdoc_array_style' => true,
'PhpCsFixerCustomFixers/phpdoc_type_list' => true,
'align_multiline_comment' => [
Expand Down
4 changes: 4 additions & 0 deletions test/Unit/RuleSet/Php55Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ protected function expectedCustomFixers(): Fixers
{
return Fixers::fromFixers(
new Fixer\MultilineCommentOpeningClosingAloneFixer(),
new Fixer\NoDuplicatedArrayKeyFixer(),
new Fixer\PhpdocArrayStyleFixer(),
new Fixer\PhpdocTypeListFixer(),
new PhpCsFixer\Whitespace\LineBreakAfterStatementsFixer(),
Expand Down Expand Up @@ -70,6 +71,9 @@ protected function expectedRules(): Rules
return Rules::fromArray([
'ErickSkrauch/line_break_after_statements' => true,
'PhpCsFixerCustomFixers/multiline_comment_opening_closing_alone' => true,
'PhpCsFixerCustomFixers/no_duplicated_array_key' => [
'ignore_expressions' => true,
],
'PhpCsFixerCustomFixers/phpdoc_array_style' => true,
'PhpCsFixerCustomFixers/phpdoc_type_list' => true,
'align_multiline_comment' => [
Expand Down
4 changes: 4 additions & 0 deletions test/Unit/RuleSet/Php56Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ protected function expectedCustomFixers(): Fixers
{
return Fixers::fromFixers(
new Fixer\MultilineCommentOpeningClosingAloneFixer(),
new Fixer\NoDuplicatedArrayKeyFixer(),
new Fixer\PhpdocArrayStyleFixer(),
new Fixer\PhpdocTypeListFixer(),
new PhpCsFixer\Whitespace\LineBreakAfterStatementsFixer(),
Expand All @@ -70,6 +71,9 @@ protected function expectedRules(): Rules
return Rules::fromArray([
'ErickSkrauch/line_break_after_statements' => true,
'PhpCsFixerCustomFixers/multiline_comment_opening_closing_alone' => true,
'PhpCsFixerCustomFixers/no_duplicated_array_key' => [
'ignore_expressions' => true,
],
'PhpCsFixerCustomFixers/phpdoc_array_style' => true,
'PhpCsFixerCustomFixers/phpdoc_type_list' => true,
'align_multiline_comment' => [
Expand Down
4 changes: 4 additions & 0 deletions test/Unit/RuleSet/Php70Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ protected function expectedCustomFixers(): Fixers
{
return Fixers::fromFixers(
new Fixer\MultilineCommentOpeningClosingAloneFixer(),
new Fixer\NoDuplicatedArrayKeyFixer(),
new Fixer\PhpdocArrayStyleFixer(),
new Fixer\PhpdocTypeListFixer(),
new PhpCsFixer\Whitespace\LineBreakAfterStatementsFixer(),
Expand All @@ -70,6 +71,9 @@ protected function expectedRules(): Rules
return Rules::fromArray([
'ErickSkrauch/line_break_after_statements' => true,
'PhpCsFixerCustomFixers/multiline_comment_opening_closing_alone' => true,
'PhpCsFixerCustomFixers/no_duplicated_array_key' => [
'ignore_expressions' => true,
],
'PhpCsFixerCustomFixers/phpdoc_array_style' => true,
'PhpCsFixerCustomFixers/phpdoc_type_list' => true,
'align_multiline_comment' => [
Expand Down
4 changes: 4 additions & 0 deletions test/Unit/RuleSet/Php71Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ protected function expectedCustomFixers(): Fixers
{
return Fixers::fromFixers(
new Fixer\MultilineCommentOpeningClosingAloneFixer(),
new Fixer\NoDuplicatedArrayKeyFixer(),
new Fixer\PhpdocArrayStyleFixer(),
new Fixer\PhpdocTypeListFixer(),
new PhpCsFixer\Whitespace\LineBreakAfterStatementsFixer(),
Expand All @@ -70,6 +71,9 @@ protected function expectedRules(): Rules
return Rules::fromArray([
'ErickSkrauch/line_break_after_statements' => true,
'PhpCsFixerCustomFixers/multiline_comment_opening_closing_alone' => true,
'PhpCsFixerCustomFixers/no_duplicated_array_key' => [
'ignore_expressions' => true,
],
'PhpCsFixerCustomFixers/phpdoc_array_style' => true,
'PhpCsFixerCustomFixers/phpdoc_type_list' => true,
'align_multiline_comment' => [
Expand Down
4 changes: 4 additions & 0 deletions test/Unit/RuleSet/Php72Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ protected function expectedCustomFixers(): Fixers
{
return Fixers::fromFixers(
new Fixer\MultilineCommentOpeningClosingAloneFixer(),
new Fixer\NoDuplicatedArrayKeyFixer(),
new Fixer\PhpdocArrayStyleFixer(),
new Fixer\PhpdocTypeListFixer(),
new PhpCsFixer\Whitespace\LineBreakAfterStatementsFixer(),
Expand All @@ -70,6 +71,9 @@ protected function expectedRules(): Rules
return Rules::fromArray([
'ErickSkrauch/line_break_after_statements' => true,
'PhpCsFixerCustomFixers/multiline_comment_opening_closing_alone' => true,
'PhpCsFixerCustomFixers/no_duplicated_array_key' => [
'ignore_expressions' => true,
],
'PhpCsFixerCustomFixers/phpdoc_array_style' => true,
'PhpCsFixerCustomFixers/phpdoc_type_list' => true,
'align_multiline_comment' => [
Expand Down
Loading

0 comments on commit 8f35865

Please sign in to comment.