diff --git a/src/ConfigBuilder.php b/src/ConfigBuilder.php index debfa05a..b81da6af 100644 --- a/src/ConfigBuilder.php +++ b/src/ConfigBuilder.php @@ -22,6 +22,15 @@ final class ConfigBuilder { private Config $config; + private function __construct(private readonly RuleSet $ruleSet) + { + $this->config = new Config($ruleSet->name()); + $this->config + ->setRiskyAllowed($ruleSet->allowRisky()) + ->setUsingCache($ruleSet->useCache()) + ; + } + public static function createFromRuleSet(RuleSet $ruleSet): self { return new self($ruleSet); @@ -67,15 +76,6 @@ public function getConfig(): ConfigInterface return $this->config->setRules($this->ruleSet->rules()); } - private function __construct(private readonly RuleSet $ruleSet) - { - $this->config = new Config($ruleSet->name()); - $this->config - ->setRiskyAllowed($ruleSet->allowRisky()) - ->setUsingCache($ruleSet->useCache()) - ; - } - private function getFinder(): Finder { return $this->config->getFinder(); diff --git a/src/RuleSets/DefaultSet.php b/src/RuleSets/DefaultSet.php index f3f831eb..475c2142 100644 --- a/src/RuleSets/DefaultSet.php +++ b/src/RuleSets/DefaultSet.php @@ -79,6 +79,7 @@ public function rules(): array 'property_protected', 'property_private_static', 'property_private', + 'construct', 'method_public_static', 'method_protected_static', 'method_private_static', @@ -90,7 +91,6 @@ public function rules(): array 'method_public', 'method_protected', 'method_private', - 'destruct', ], ], 'global_namespace_import' => [ diff --git a/src/RuleSets/ExtendedPERSet.php b/src/RuleSets/ExtendedPERSet.php index d35da2cb..ff546d02 100644 --- a/src/RuleSets/ExtendedPERSet.php +++ b/src/RuleSets/ExtendedPERSet.php @@ -96,27 +96,28 @@ public function rules(): array 'sort_algorithm' => 'none', 'order' => [ 'use_trait', - 'constant_public', - 'constant_protected', - 'constant_private', - 'property_public_static', + 'case', + 'constant', + // 'property_public_static', 'property_public', - 'property_protected_static', + // 'property_protected_static', 'property_protected', - 'property_private_static', + // 'property_private_static', 'property_private', + 'construct', 'method_public_static', - 'method_protected_static', - 'method_private_static', - 'method_public_abstract_static', - 'method_protected_abstract_static', - 'method_public_abstract', - 'method_protected_abstract', - 'phpunit', + // 'method_public_abstract_static', + // 'method_public_abstract', 'method_public', + 'magic', + 'destruct', + 'phpunit', + 'method_protected_static', + // 'method_protected_abstract_static', + // 'method_protected_abstract', 'method_protected', + 'method_private_static', 'method_private', - 'destruct', ], ], 'method_argument_space' => [