function ProcessHelper::mustRun
Runs the process.
This is identical to run() except that an exception is thrown if the process exits with a non-zero exit code.
Parameters
array|Process $cmd An instance of Process or a command to run:
callable|null $callback A PHP callback to run whenever there is some: output available on STDOUT or STDERR
Throws
See also
run()
File
-
vendor/
symfony/ console/ Helper/ ProcessHelper.php, line 97
Class
- ProcessHelper
- The ProcessHelper class provides helpers to run external processes.
Namespace
Symfony\Component\Console\HelperCode
public function mustRun(OutputInterface $output, array|Process $cmd, ?string $error = null, ?callable $callback = null, int $verbosity = OutputInterface::VERBOSITY_VERY_VERBOSE) : Process {
$process = $this->run($output, $cmd, $error, $callback, $verbosity);
if (!$process->isSuccessful()) {
throw new ProcessFailedException($process);
}
return $process;
}