diff --git a/CHANGELOG.md b/CHANGELOG.md index 895608ff..1b0a02bd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,7 +11,8 @@ For a full diff see [`6.28.1...main`][6.28.1...main]. ### Changed - Updated `friendsofphp/php-cs-fixer` ([#1065]), by [@dependabot] -- +- Enabled parallel runner ([#1066]), by [@localheinz] + ## [`6.28.1`][6.28.1] For a full diff see [`6.28.0...6.28.1`][6.28.0...6.28.1]. @@ -1650,6 +1651,7 @@ For a full diff see [`d899e77...1.0.0`][d899e77...1.0.0]. [#1061]: https://github.com/ergebnis/php-cs-fixer-config/pull/1061 [#1062]: https://github.com/ergebnis/php-cs-fixer-config/pull/1062 [#1065]: https://github.com/ergebnis/php-cs-fixer-config/pull/1065 +[#1066]: https://github.com/ergebnis/php-cs-fixer-config/pull/1066 [@dependabot]: https://github.com/apps/dependabot [@linuxjuggler]: https://github.com/linuxjuggler diff --git a/src/Factory.php b/src/Factory.php index 0bb38c08..1a624cc1 100644 --- a/src/Factory.php +++ b/src/Factory.php @@ -14,6 +14,7 @@ namespace Ergebnis\PhpCsFixer\Config; use PhpCsFixer\Config; +use PhpCsFixer\Runner; final class Factory { @@ -37,6 +38,7 @@ public static function fromRuleSet(RuleSet $ruleSet): Config $config = new Config($ruleSet->name()->toString()); $config->registerCustomFixers($ruleSet->customFixers()->toArray()); + $config->setParallelConfig(Runner\Parallel\ParallelConfigFactory::detect()); $config->setRiskyAllowed(true); $config->setRules($ruleSet->rules()->toArray()); diff --git a/test/Unit/FactoryTest.php b/test/Unit/FactoryTest.php index 14d6a199..afae087a 100644 --- a/test/Unit/FactoryTest.php +++ b/test/Unit/FactoryTest.php @@ -21,6 +21,7 @@ use Ergebnis\PhpCsFixer\Config\RuleSet; use Ergebnis\PhpCsFixer\Config\Test; use PhpCsFixer\Fixer; +use PhpCsFixer\Runner; use PHPUnit\Framework; /** @@ -92,6 +93,7 @@ public function testFromRuleSetCreatesConfigWhenCurrentPhpVersionIsEqualToOrGrea $config = Factory::fromRuleSet($ruleSet); self::assertEquals($customFixers->toArray(), $config->getCustomFixers()); + self::assertEquals(Runner\Parallel\ParallelConfigFactory::detect(), $config->getParallelConfig()); self::assertTrue($config->getRiskyAllowed()); self::assertSame($rules->toArray(), $config->getRules()); self::assertTrue($config->getUsingCache());