From 78f1b75bcf5b31c4c98cf42c02997934cb981c6c Mon Sep 17 00:00:00 2001 From: Kei Date: Sat, 3 Aug 2024 03:35:53 +0700 Subject: [PATCH] relaxplus: Improve `ordered_class_elements` --- src/RuleSet/Sets/RelaxPlus.php | 3 ++- tests/Fixtures/Ruleset/relaxplus_expected.php | 16 ++++++++-------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/RuleSet/Sets/RelaxPlus.php b/src/RuleSet/Sets/RelaxPlus.php index 89b4b73..88d7c9b 100644 --- a/src/RuleSet/Sets/RelaxPlus.php +++ b/src/RuleSet/Sets/RelaxPlus.php @@ -38,7 +38,8 @@ public function mainRules(): array 'no_superfluous_elseif' => true, 'ordered_class_elements' => [ 'order' => [ - 'use_trait', 'case', 'constant_public', 'constant_protected', 'constant_private', 'property_public', 'property_protected', 'property_private', 'construct', 'destruct', 'magic', 'phpunit', + 'use_trait', 'case', 'constant', 'property', + 'construct', 'destruct', 'magic', ], ], diff --git a/tests/Fixtures/Ruleset/relaxplus_expected.php b/tests/Fixtures/Ruleset/relaxplus_expected.php index c60cfd3..addc3a9 100644 --- a/tests/Fixtures/Ruleset/relaxplus_expected.php +++ b/tests/Fixtures/Ruleset/relaxplus_expected.php @@ -86,24 +86,24 @@ final class OrderedClassElements const C2 = 2; + protected static $protStatProp; + public static $pubStatProp1; public $pubProp1; - public $pubProp2; - - public static $pubStatProp2; - - public $pubProp3; - - protected static $protStatProp; - protected $protProp; + public $pubProp2; + private static $privStatProp; private $privProp; + public static $pubStatProp2; + + public $pubProp3; + protected function __construct() {} public function __destruct() {}