function ProcessHelper::wrapCallback
Wraps a Process callback to add debugging output.
1 call to ProcessHelper::wrapCallback()
- ProcessHelper::run in vendor/
symfony/ console/ Helper/ ProcessHelper.php - Runs an external process.
File
-
vendor/
symfony/ console/ Helper/ ProcessHelper.php, line 111
Class
- ProcessHelper
- The ProcessHelper class provides helpers to run external processes.
Namespace
Symfony\Component\Console\HelperCode
public function wrapCallback(OutputInterface $output, Process $process, ?callable $callback = null) : callable {
if ($output instanceof ConsoleOutputInterface) {
$output = $output->getErrorOutput();
}
$formatter = $this->getHelperSet()
->get('debug_formatter');
return function ($type, $buffer) use ($output, $process, $callback, $formatter) {
$output->write($formatter->progress(spl_object_hash($process), $this->escapeString($buffer), Process::ERR === $type));
if (null !== $callback) {
$callback($type, $buffer);
}
};
}