24
24
use Webmozarts \Console \Parallelization \Process \StandardSymfonyProcessFactory ;
25
25
use Webmozarts \Console \Parallelization \Process \SymfonyProcessLauncherFactory ;
26
26
use function chr ;
27
+ use function explode ;
28
+ use function is_string ;
27
29
use function Safe \getcwd ;
28
30
use function str_starts_with ;
29
31
use const DIRECTORY_SEPARATOR ;
@@ -46,6 +48,7 @@ final class ParallelExecutorFactory
46
48
* @param Closure(InputInterface, OutputInterface):void $runAfterLastCommand
47
49
* @param Closure(InputInterface, OutputInterface, list<string>):void $runBeforeBatch
48
50
* @param Closure(InputInterface, OutputInterface, list<string>):void $runAfterBatch
51
+ * @param list<string> $phpExecutable
49
52
* @param array<string, string> $extraEnvironmentVariables
50
53
* @param Closure(): void $processTick
51
54
*/
@@ -64,7 +67,7 @@ private function __construct(
64
67
private Closure $ runBeforeBatch ,
65
68
private Closure $ runAfterBatch ,
66
69
private string $ progressSymbol ,
67
- private string $ phpExecutable ,
70
+ private array $ phpExecutable ,
68
71
private string $ scriptPath ,
69
72
private string $ workingDirectory ,
70
73
private ?array $ extraEnvironmentVariables ,
@@ -228,11 +231,17 @@ public function withProgressSymbol(string $progressSymbol): self
228
231
/**
229
232
* The path of the PHP executable. It is the executable that will be used
230
233
* to spawn the child process(es).
234
+ *
235
+ * @param string|list<string> $phpExecutable
231
236
*/
232
- public function withPhpExecutable (string $ phpExecutable ): self
237
+ public function withPhpExecutable (string | array $ phpExecutable ): self
233
238
{
239
+ $ normalizedExecutable = is_string ($ phpExecutable )
240
+ ? explode (' ' , $ phpExecutable )
241
+ : $ phpExecutable ;
242
+
234
243
$ clone = clone $ this ;
235
- $ clone ->phpExecutable = $ phpExecutable ;
244
+ $ clone ->phpExecutable = $ normalizedExecutable ;
236
245
237
246
return $ clone ;
238
247
}
0 commit comments