diff --git a/CHANGELOG.md b/CHANGELOG.md index 1ef4c771..f32d39c1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ For a full diff see [`6.26.0...main`][6.26.0...main]. ### Changed - Updated `friendsofphp/php-cs-fixer` ([#1058]), by [@dependabot] +- Enabled and configured the `ordered_attributes` fixer ([#1060]), by [@localheinz] ## [`6.26.0`][6.26.0] @@ -1615,6 +1616,7 @@ For a full diff see [`d899e77...1.0.0`][d899e77...1.0.0]. [#1039]: https://github.com/ergebnis/php-cs-fixer-config/pull/1039 [#1051]: https://github.com/ergebnis/php-cs-fixer-config/pull/1051 [#1058]: https://github.com/ergebnis/php-cs-fixer-config/pull/1058 +[#1060]: https://github.com/ergebnis/php-cs-fixer-config/pull/1060 [@dependabot]: https://github.com/apps/dependabot [@linuxjuggler]: https://github.com/linuxjuggler diff --git a/src/RuleSet/Php80.php b/src/RuleSet/Php80.php index 10cc38c5..284d12c1 100644 --- a/src/RuleSet/Php80.php +++ b/src/RuleSet/Php80.php @@ -452,7 +452,10 @@ public static function create(): RuleSet 'only_booleans' => true, 'position' => 'beginning', ], - 'ordered_attributes' => false, + 'ordered_attributes' => [ + 'order' => [], + 'sort_algorithm' => 'alpha', + ], 'ordered_class_elements' => [ 'case_sensitive' => false, 'order' => [ diff --git a/src/RuleSet/Php81.php b/src/RuleSet/Php81.php index 9a7161cc..361a5194 100644 --- a/src/RuleSet/Php81.php +++ b/src/RuleSet/Php81.php @@ -453,7 +453,10 @@ public static function create(): RuleSet 'only_booleans' => true, 'position' => 'beginning', ], - 'ordered_attributes' => false, + 'ordered_attributes' => [ + 'order' => [], + 'sort_algorithm' => 'alpha', + ], 'ordered_class_elements' => [ 'case_sensitive' => false, 'order' => [ diff --git a/src/RuleSet/Php82.php b/src/RuleSet/Php82.php index 36038b2a..0fdb2960 100644 --- a/src/RuleSet/Php82.php +++ b/src/RuleSet/Php82.php @@ -453,7 +453,10 @@ public static function create(): RuleSet 'only_booleans' => true, 'position' => 'beginning', ], - 'ordered_attributes' => false, + 'ordered_attributes' => [ + 'order' => [], + 'sort_algorithm' => 'alpha', + ], 'ordered_class_elements' => [ 'case_sensitive' => false, 'order' => [ diff --git a/src/RuleSet/Php83.php b/src/RuleSet/Php83.php index a9b478f2..35dc91ba 100644 --- a/src/RuleSet/Php83.php +++ b/src/RuleSet/Php83.php @@ -453,7 +453,10 @@ public static function create(): RuleSet 'only_booleans' => true, 'position' => 'beginning', ], - 'ordered_attributes' => false, + 'ordered_attributes' => [ + 'order' => [], + 'sort_algorithm' => 'alpha', + ], 'ordered_class_elements' => [ 'case_sensitive' => false, 'order' => [ diff --git a/test/Unit/RuleSet/Php80Test.php b/test/Unit/RuleSet/Php80Test.php index 5b428fe1..d5234563 100644 --- a/test/Unit/RuleSet/Php80Test.php +++ b/test/Unit/RuleSet/Php80Test.php @@ -475,7 +475,10 @@ protected function expectedRules(): Rules 'only_booleans' => true, 'position' => 'beginning', ], - 'ordered_attributes' => false, + 'ordered_attributes' => [ + 'order' => [], + 'sort_algorithm' => 'alpha', + ], 'ordered_class_elements' => [ 'case_sensitive' => false, 'order' => [ diff --git a/test/Unit/RuleSet/Php81Test.php b/test/Unit/RuleSet/Php81Test.php index bcded3cc..da1dcf1b 100644 --- a/test/Unit/RuleSet/Php81Test.php +++ b/test/Unit/RuleSet/Php81Test.php @@ -476,7 +476,10 @@ protected function expectedRules(): Rules 'only_booleans' => true, 'position' => 'beginning', ], - 'ordered_attributes' => false, + 'ordered_attributes' => [ + 'order' => [], + 'sort_algorithm' => 'alpha', + ], 'ordered_class_elements' => [ 'case_sensitive' => false, 'order' => [ diff --git a/test/Unit/RuleSet/Php82Test.php b/test/Unit/RuleSet/Php82Test.php index 05a82f38..8b0b8c6b 100644 --- a/test/Unit/RuleSet/Php82Test.php +++ b/test/Unit/RuleSet/Php82Test.php @@ -476,7 +476,10 @@ protected function expectedRules(): Rules 'only_booleans' => true, 'position' => 'beginning', ], - 'ordered_attributes' => false, + 'ordered_attributes' => [ + 'order' => [], + 'sort_algorithm' => 'alpha', + ], 'ordered_class_elements' => [ 'case_sensitive' => false, 'order' => [ diff --git a/test/Unit/RuleSet/Php83Test.php b/test/Unit/RuleSet/Php83Test.php index d075f5ee..b74f93d5 100644 --- a/test/Unit/RuleSet/Php83Test.php +++ b/test/Unit/RuleSet/Php83Test.php @@ -476,7 +476,10 @@ protected function expectedRules(): Rules 'only_booleans' => true, 'position' => 'beginning', ], - 'ordered_attributes' => false, + 'ordered_attributes' => [ + 'order' => [], + 'sort_algorithm' => 'alpha', + ], 'ordered_class_elements' => [ 'case_sensitive' => false, 'order' => [