@@ -340,7 +340,7 @@ public function start(?callable $callback = null, array $env = [])
340340 }
341341
342342 if (!is_dir ($ this ->cwd )) {
343- throw new RuntimeException (sprintf ('The provided cwd "%s" does not exist. ' , $ this ->cwd ));
343+ throw new RuntimeException (\ sprintf ('The provided cwd "%s" does not exist. ' , $ this ->cwd ));
344344 }
345345
346346 $ process = @proc_open ($ commandline , $ descriptors , $ this ->processPipes ->pipes , $ this ->cwd , $ envPairs , $ this ->options );
@@ -1197,7 +1197,7 @@ public function setOptions(array $options)
11971197 foreach ($ options as $ key => $ value ) {
11981198 if (!\in_array ($ key , $ existingOptions )) {
11991199 $ this ->options = $ defaultOptions ;
1200- throw new LogicException (sprintf ('Invalid option "%s" passed to "%s()". Supported options are "%s". ' , $ key , __METHOD__ , implode ('", " ' , $ existingOptions )));
1200+ throw new LogicException (\ sprintf ('Invalid option "%s" passed to "%s()". Supported options are "%s". ' , $ key , __METHOD__ , implode ('", " ' , $ existingOptions )));
12011201 }
12021202 $ this ->options [$ key ] = $ value ;
12031203 }
@@ -1453,10 +1453,10 @@ private function doSignal(int $signal, bool $throwException): bool
14531453 }
14541454
14551455 if ('\\' === \DIRECTORY_SEPARATOR ) {
1456- exec (sprintf ('taskkill /F /T /PID %d 2>&1 ' , $ pid ), $ output , $ exitCode );
1456+ exec (\ sprintf ('taskkill /F /T /PID %d 2>&1 ' , $ pid ), $ output , $ exitCode );
14571457 if ($ exitCode && $ this ->isRunning ()) {
14581458 if ($ throwException ) {
1459- throw new RuntimeException (sprintf ('Unable to kill the process (%s). ' , implode (' ' , $ output )));
1459+ throw new RuntimeException (\ sprintf ('Unable to kill the process (%s). ' , implode (' ' , $ output )));
14601460 }
14611461
14621462 return false ;
@@ -1466,12 +1466,12 @@ private function doSignal(int $signal, bool $throwException): bool
14661466 $ ok = @proc_terminate ($ this ->process , $ signal );
14671467 } elseif (\function_exists ('posix_kill ' )) {
14681468 $ ok = @posix_kill ($ pid , $ signal );
1469- } elseif ($ ok = proc_open (sprintf ('kill -%d %d ' , $ signal , $ pid ), [2 => ['pipe ' , 'w ' ]], $ pipes )) {
1469+ } elseif ($ ok = proc_open (\ sprintf ('kill -%d %d ' , $ signal , $ pid ), [2 => ['pipe ' , 'w ' ]], $ pipes )) {
14701470 $ ok = false === fgets ($ pipes [2 ]);
14711471 }
14721472 if (!$ ok ) {
14731473 if ($ throwException ) {
1474- throw new RuntimeException (sprintf ('Error while sending signal "%s". ' , $ signal ));
1474+ throw new RuntimeException (\ sprintf ('Error while sending signal "%s". ' , $ signal ));
14751475 }
14761476
14771477 return false ;
@@ -1528,7 +1528,7 @@ function ($m) use (&$env, $uid) {
15281528
15291529 if (!$ comSpec && $ comSpec = (new ExecutableFinder ())->find ('cmd.exe ' )) {
15301530 // Escape according to CommandLineToArgvW rules
1531- $ comSpec = '" ' .preg_replace ('{( \\\\*+)"} ' , '$1$1\" ' , $ comSpec ) .'" ' ;
1531+ $ comSpec = '" ' .preg_replace ('{( \\\\*+)"} ' , '$1$1\" ' , $ comSpec ).'" ' ;
15321532 }
15331533
15341534 $ cmd = ($ comSpec ?? 'cmd ' ).' /V:ON /E:ON /D /C ( ' .str_replace ("\n" , ' ' , $ cmd ).') ' ;
@@ -1547,7 +1547,7 @@ function ($m) use (&$env, $uid) {
15471547 private function requireProcessIsStarted (string $ functionName ): void
15481548 {
15491549 if (!$ this ->isStarted ()) {
1550- throw new LogicException (sprintf ('Process must be started before calling "%s()". ' , $ functionName ));
1550+ throw new LogicException (\ sprintf ('Process must be started before calling "%s()". ' , $ functionName ));
15511551 }
15521552 }
15531553
@@ -1559,7 +1559,7 @@ private function requireProcessIsStarted(string $functionName): void
15591559 private function requireProcessIsTerminated (string $ functionName ): void
15601560 {
15611561 if (!$ this ->isTerminated ()) {
1562- throw new LogicException (sprintf ('Process must be terminated before calling "%s()". ' , $ functionName ));
1562+ throw new LogicException (\ sprintf ('Process must be terminated before calling "%s()". ' , $ functionName ));
15631563 }
15641564 }
15651565
@@ -1589,7 +1589,7 @@ private function replacePlaceholders(string $commandline, array $env): string
15891589 {
15901590 return preg_replace_callback ('/"\$\{:([_a-zA-Z]++[_a-zA-Z0-9]*+)\}"/ ' , function ($ matches ) use ($ commandline , $ env ) {
15911591 if (!isset ($ env [$ matches [1 ]]) || false === $ env [$ matches [1 ]]) {
1592- throw new InvalidArgumentException (sprintf ('Command line is missing a value for parameter "%s": ' , $ matches [1 ]).$ commandline );
1592+ throw new InvalidArgumentException (\ sprintf ('Command line is missing a value for parameter "%s": ' , $ matches [1 ]).$ commandline );
15931593 }
15941594
15951595 return $ this ->escapeArgument ($ env [$ matches [1 ]]);
0 commit comments