src/main/php/CommandLine/Library/GenericCommandRunner.php
private function runAndWriteToOutput($commandWithParameters)
    {
        $exitCode = 0;
        $process = $this->processRunner->runAsProcessReturningProcessObject(
            $commandWithParameters
        );
        if ($process->getExitCode() !== 0) {
            $exitCode = $process->getExitCode();
            $this->output->writeln($process->getOutput(), OutputInterface::OUTPUT_NORMAL);
            $this->output->writeln($process->getErrorOutput(), OutputInterface::VERBOSITY_NORMAL);
        }

        return $exitCode;
    }
private function runAndWriteToOutput($commandWithParameters)
    {
        $exitCode = 0;
        $process = $this->processRunner->runAsProcessReturningProcessObject(
            $commandWithParameters
        );
        if ($process->getExitCode() !== 0) {
            $exitCode = $process->getExitCode();
            $this->output->writeln($process->getOutput(), OutputInterface::OUTPUT_NORMAL);
            $this->output->writeln($process->getErrorOutput(), OutputInterface::VERBOSITY_NORMAL);
        }

        return $exitCode;
    }
private function runAndWriteToOutput ( $ commandWithParameters ) { $ exitCode = 0 ; $ process = $ this -> processRunner -> runAsProcessReturningProcessObject ( $ commandWithParameters ) ; if ( $ process -> getExitCode ( ) !== 0 ) { $ exitCode = $ process -> getExitCode ( ) ; $ this -> output -> writeln ( $ process -> getOutput ( ) , OutputInterface :: OUTPUT_NORMAL ) ; $ this -> output -> writeln ( $ process -> getErrorOutput ( ) , OutputInterface :: VERBOSITY_NORMAL ) ; } return $ exitCode ; }
Runs a command and prints the output to the screen if the command couldn't be executed without errors.

@param string $commandWithParameters

@return int
Runs a command and prints the output to the screen if the command couldn t be executed without errors .