From d63f17f7e02e3fb07799db62a3957ccf00e44779 Mon Sep 17 00:00:00 2001 From: lotyp Date: Thu, 23 May 2024 14:22:20 +0300 Subject: [PATCH 1/3] fix: do not force multiline doc blocks --- src/RuleSets/ExtendedPERSet.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/RuleSets/ExtendedPERSet.php b/src/RuleSets/ExtendedPERSet.php index ff546d02..919671ac 100644 --- a/src/RuleSets/ExtendedPERSet.php +++ b/src/RuleSets/ExtendedPERSet.php @@ -166,9 +166,9 @@ public function rules(): array 'use_parentheses' => false, ], 'phpdoc_line_span' => [ - 'const' => 'multi', + 'const' => null, 'method' => 'multi', - 'property' => 'multi', + 'property' => null, ], ], $this->rules); } From 1921d3832a897f455cc9e24ca9a6a70ff368961e Mon Sep 17 00:00:00 2001 From: lotyp Date: Thu, 23 May 2024 14:28:56 +0300 Subject: [PATCH 2/3] fix: remove php_doc_align fixer --- src/RuleSets/ExtendedPERSet.php | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/RuleSets/ExtendedPERSet.php b/src/RuleSets/ExtendedPERSet.php index 919671ac..6475808a 100644 --- a/src/RuleSets/ExtendedPERSet.php +++ b/src/RuleSets/ExtendedPERSet.php @@ -46,9 +46,6 @@ public function rules(): array /* * @Symfony */ - 'phpdoc_align' => [ - 'align' => 'left', - ], 'yoda_style' => [ 'equal' => false, 'identical' => false, From d1f30ec67215bf4a0c4a78a752bb89979e427fa4 Mon Sep 17 00:00:00 2001 From: lotyp Date: Thu, 23 May 2024 14:43:38 +0300 Subject: [PATCH 3/3] fix: PSR-12 space_before_parenthesis --- src/ConfigBuilder.php | 10 ++++++++++ src/RuleSets/DefaultSet.php | 3 +++ src/RuleSets/ExtendedPERSet.php | 7 +++++++ 3 files changed, 20 insertions(+) diff --git a/src/ConfigBuilder.php b/src/ConfigBuilder.php index b81da6af..54ab11ec 100644 --- a/src/ConfigBuilder.php +++ b/src/ConfigBuilder.php @@ -71,6 +71,16 @@ public function addFiles(array $files): self return $this; } + /** + * @param list $files + */ + public function exclude(array $files): self + { + $this->getFinder()->exclude($files); + + return $this; + } + public function getConfig(): ConfigInterface { return $this->config->setRules($this->ruleSet->rules()); diff --git a/src/RuleSets/DefaultSet.php b/src/RuleSets/DefaultSet.php index 475c2142..1c2ff468 100644 --- a/src/RuleSets/DefaultSet.php +++ b/src/RuleSets/DefaultSet.php @@ -148,6 +148,9 @@ public function rules(): array 'self_static_accessor' => true, 'no_useless_else' => true, 'no_useless_return' => true, + 'class_definition' => [ + 'space_before_parenthesis' => false, + ], /* * @PhpCsFixer:risky diff --git a/src/RuleSets/ExtendedPERSet.php b/src/RuleSets/ExtendedPERSet.php index 6475808a..75aac8ad 100644 --- a/src/RuleSets/ExtendedPERSet.php +++ b/src/RuleSets/ExtendedPERSet.php @@ -43,6 +43,13 @@ public function rules(): array */ '@PER-CS2.0' => true, + /* + * @PER-CS2.0 Overrides + */ + 'class_definition' => [ + 'space_before_parenthesis' => false, + ], + /* * @Symfony */