Skip to content

Commit

Permalink
[Configuration] Do not sets, skip, rules on empty array on RectorConf…
Browse files Browse the repository at this point in the history
…igBuilder (#5731)
  • Loading branch information
samsonasik committed Mar 17, 2024
1 parent a94605a commit 1764c19
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/Configuration/RectorConfigBuilder.php
Expand Up @@ -149,7 +149,9 @@ public function __invoke(RectorConfig $rectorConfig): void
));
}

$rectorConfig->sets($uniqueSets);
if ($uniqueSets !== []) {
$rectorConfig->sets($uniqueSets);
}

if ($this->paths !== []) {
$rectorConfig->paths($this->paths);
Expand All @@ -168,8 +170,13 @@ public function __invoke(RectorConfig $rectorConfig): void
}
}

$rectorConfig->skip($this->skip);
$rectorConfig->rules($this->rules);
if ($this->skip !== []) {
$rectorConfig->skip($this->skip);
}

if ($this->rules !== []) {
$rectorConfig->rules($this->rules);
}

foreach ($this->rulesWithConfigurations as $rectorClass => $configurations) {
foreach ($configurations as $configuration) {
Expand Down

0 comments on commit 1764c19

Please sign in to comment.