protected function runProcess(Process $process)
    {
        $ioHandler = $this->getIO();
        $process->run(
            function ($pipe, $content) use ($ioHandler) {
                if (Process::ERR === $pipe) {
                    $ioHandler->writeError($content, false);
                    // @codingStandardsIgnoreStart
                    return;
                    // @codingStandardsIgnoreEnd
                }
                $ioHandler->write($content, false);
            }
        );

        if (0 !== $process->getExitCode()) {
            throw new ProcessFailedException($process);
        }
    }