File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change 1111use Composer \InstalledVersions ;
1212use Ibexa \CodeStyle \PhpCsFixer \Sets \RuleSetInterface ;
1313use PhpCsFixer \ConfigInterface ;
14+ use PhpCsFixer \ParallelAwareConfigInterface ;
15+ use PhpCsFixer \Runner \Parallel \ParallelConfigFactory ;
1416
1517/**
1618 * Factory for Config instance that should be used for all internal Ibexa packages.
@@ -24,6 +26,8 @@ final class InternalConfigFactory
2426
2527 private RuleSetInterface $ ruleSet ;
2628
29+ private bool $ runInParallel = false ;
30+
2731 /**
2832 * @param array<string, mixed> $rules
2933 */
@@ -46,6 +50,13 @@ public function getRuleSet(): RuleSetInterface
4650 return $ this ->ruleSet ??= $ this ->createRuleSetFromPackage (InstalledVersions::getRootPackage ());
4751 }
4852
53+ public function runInParallel (bool $ runInParallel = true ): self
54+ {
55+ $ this ->runInParallel = $ runInParallel ;
56+
57+ return $ this ;
58+ }
59+
4960 /**
5061 * @param array{name: string, version: string, pretty_version?: string} $package
5162 */
@@ -78,6 +89,10 @@ public function buildConfig(): ConfigInterface
7889 $ this ->customRules ,
7990 ));
8091
92+ if ($ this ->runInParallel && $ config instanceof ParallelAwareConfigInterface) {
93+ $ config ->setParallelConfig (ParallelConfigFactory::detect ());
94+ }
95+
8196 return $ config ;
8297 }
8398
You can’t perform that action at this time.
0 commit comments