From cb76a5fb76548fd3b659c0af8b9e89625319e5fc Mon Sep 17 00:00:00 2001 From: Tomas Votruba Date: Tue, 19 Nov 2024 19:25:55 +0100 Subject: [PATCH] [dx] enable all attributes, if none are selected to streamline config (#6451) --- rector.php | 1 + src/Configuration/RectorConfigBuilder.php | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/rector.php b/rector.php index 3a6c449dc2e..997d7c85b14 100644 --- a/rector.php +++ b/rector.php @@ -21,6 +21,7 @@ rectorPreset: true, phpunitCodeQuality: true ) + ->withAttributesSets() ->withComposerBased(phpunit: true) ->withPhpSets() ->withPaths([ diff --git a/src/Configuration/RectorConfigBuilder.php b/src/Configuration/RectorConfigBuilder.php index 6f81f0549f8..2646bc13f86 100644 --- a/src/Configuration/RectorConfigBuilder.php +++ b/src/Configuration/RectorConfigBuilder.php @@ -447,6 +447,11 @@ public function withAttributesSets( bool $sensiolabs = false, bool $all = false ): self { + // if nothing is passed, enable all as convention in other method + if (func_get_args() === []) { + $all = true; + } + if ($symfony || $all) { $this->sets[] = SymfonySetList::ANNOTATIONS_TO_ATTRIBUTES; }