Skip to content

Commit

Permalink
[Configuration] Fix parallel config always replaced by next config pe…
Browse files Browse the repository at this point in the history
…r-default true (#5683)
  • Loading branch information
samsonasik committed Mar 3, 2024
1 parent 1ae6844 commit b523b73
Showing 1 changed file with 11 additions and 12 deletions.
23 changes: 11 additions & 12 deletions src/Configuration/RectorConfigBuilder.php
Expand Up @@ -70,10 +70,7 @@ final class RectorConfigBuilder

private ?string $containerCacheDirectory = null;

/**
* Enabled by default
*/
private bool $parallel = true;
private ?bool $parallel = null;

private int $parallelTimeoutSeconds = 120;

Expand Down Expand Up @@ -233,14 +230,16 @@ public function __invoke(RectorConfig $rectorConfig): void
$rectorConfig->phpVersion($this->phpVersion);
}

if ($this->parallel) {
$rectorConfig->parallel(
processTimeout: $this->parallelTimeoutSeconds,
maxNumberOfProcess: $this->parallelMaxNumberOfProcess,
jobSize: $this->parallelJobSize
);
} else {
$rectorConfig->disableParallel();
if ($this->parallel !== null) {
if ($this->parallel) {
$rectorConfig->parallel(
processTimeout: $this->parallelTimeoutSeconds,
maxNumberOfProcess: $this->parallelMaxNumberOfProcess,
jobSize: $this->parallelJobSize
);
} else {
$rectorConfig->disableParallel();
}
}

if ($this->symfonyContainerXmlFile !== null) {
Expand Down

0 comments on commit b523b73

Please sign in to comment.