@@ -338,7 +338,7 @@ public function start(?callable $callback = null, array $env = []): void
338
338
}
339
339
340
340
if (!is_dir ($ this ->cwd )) {
341
- throw new RuntimeException (sprintf ('The provided cwd "%s" does not exist. ' , $ this ->cwd ));
341
+ throw new RuntimeException (\ sprintf ('The provided cwd "%s" does not exist. ' , $ this ->cwd ));
342
342
}
343
343
344
344
$ lastError = null ;
@@ -1215,7 +1215,7 @@ public function setOptions(array $options): void
1215
1215
foreach ($ options as $ key => $ value ) {
1216
1216
if (!\in_array ($ key , $ existingOptions )) {
1217
1217
$ this ->options = $ defaultOptions ;
1218
- throw new LogicException (sprintf ('Invalid option "%s" passed to "%s()". Supported options are "%s". ' , $ key , __METHOD__ , implode ('", " ' , $ existingOptions )));
1218
+ throw new LogicException (\ sprintf ('Invalid option "%s" passed to "%s()". Supported options are "%s". ' , $ key , __METHOD__ , implode ('", " ' , $ existingOptions )));
1219
1219
}
1220
1220
$ this ->options [$ key ] = $ value ;
1221
1221
}
@@ -1498,10 +1498,10 @@ private function doSignal(int $signal, bool $throwException): bool
1498
1498
}
1499
1499
1500
1500
if ('\\' === \DIRECTORY_SEPARATOR ) {
1501
- exec (sprintf ('taskkill /F /T /PID %d 2>&1 ' , $ pid ), $ output , $ exitCode );
1501
+ exec (\ sprintf ('taskkill /F /T /PID %d 2>&1 ' , $ pid ), $ output , $ exitCode );
1502
1502
if ($ exitCode && $ this ->isRunning ()) {
1503
1503
if ($ throwException ) {
1504
- throw new RuntimeException (sprintf ('Unable to kill the process (%s). ' , implode (' ' , $ output )));
1504
+ throw new RuntimeException (\ sprintf ('Unable to kill the process (%s). ' , implode (' ' , $ output )));
1505
1505
}
1506
1506
1507
1507
return false ;
@@ -1511,12 +1511,12 @@ private function doSignal(int $signal, bool $throwException): bool
1511
1511
$ ok = @proc_terminate ($ this ->process , $ signal );
1512
1512
} elseif (\function_exists ('posix_kill ' )) {
1513
1513
$ ok = @posix_kill ($ pid , $ signal );
1514
- } elseif ($ ok = proc_open (sprintf ('kill -%d %d ' , $ signal , $ pid ), [2 => ['pipe ' , 'w ' ]], $ pipes )) {
1514
+ } elseif ($ ok = proc_open (\ sprintf ('kill -%d %d ' , $ signal , $ pid ), [2 => ['pipe ' , 'w ' ]], $ pipes )) {
1515
1515
$ ok = false === fgets ($ pipes [2 ]);
1516
1516
}
1517
1517
if (!$ ok ) {
1518
1518
if ($ throwException ) {
1519
- throw new RuntimeException (sprintf ('Error while sending signal "%s". ' , $ signal ));
1519
+ throw new RuntimeException (\ sprintf ('Error while sending signal "%s". ' , $ signal ));
1520
1520
}
1521
1521
1522
1522
return false ;
@@ -1595,7 +1595,7 @@ function ($m) use (&$env, $uid) {
1595
1595
private function requireProcessIsStarted (string $ functionName ): void
1596
1596
{
1597
1597
if (!$ this ->isStarted ()) {
1598
- throw new LogicException (sprintf ('Process must be started before calling "%s()". ' , $ functionName ));
1598
+ throw new LogicException (\ sprintf ('Process must be started before calling "%s()". ' , $ functionName ));
1599
1599
}
1600
1600
}
1601
1601
@@ -1607,7 +1607,7 @@ private function requireProcessIsStarted(string $functionName): void
1607
1607
private function requireProcessIsTerminated (string $ functionName ): void
1608
1608
{
1609
1609
if (!$ this ->isTerminated ()) {
1610
- throw new LogicException (sprintf ('Process must be terminated before calling "%s()". ' , $ functionName ));
1610
+ throw new LogicException (\ sprintf ('Process must be terminated before calling "%s()". ' , $ functionName ));
1611
1611
}
1612
1612
}
1613
1613
@@ -1637,7 +1637,7 @@ private function replacePlaceholders(string $commandline, array $env): string
1637
1637
{
1638
1638
return preg_replace_callback ('/"\$\{:([_a-zA-Z]++[_a-zA-Z0-9]*+)\}"/ ' , function ($ matches ) use ($ commandline , $ env ) {
1639
1639
if (!isset ($ env [$ matches [1 ]]) || false === $ env [$ matches [1 ]]) {
1640
- throw new InvalidArgumentException (sprintf ('Command line is missing a value for parameter "%s": ' , $ matches [1 ]).$ commandline );
1640
+ throw new InvalidArgumentException (\ sprintf ('Command line is missing a value for parameter "%s": ' , $ matches [1 ]).$ commandline );
1641
1641
}
1642
1642
1643
1643
return $ this ->escapeArgument ($ env [$ matches [1 ]]);
0 commit comments