private function symfonyDoRun(InputInterface $input, OutputInterface $output, $default = 'list-commands')
    {
        if (true === $input->hasParameterOption(['--version', '-V'])) {
            $output->writeln($this->getLongVersion());

            return 0;
        }

        $name = $this->getCommandName($input);

        if (true === $input->hasParameterOption(['--help', '-h'])) {
            if (!$name) {
                $name = 'help';
                $input = new ArrayInput(['command' => 'help']);
            } else {
                // TODO $wantHelps is private in parent class
                $this->wantHelps = true;
            }
        }

        if (!$name) {
            $name = $default;
            $input = new ArrayInput(['command' => $default]);
        }

        // the command name MUST be the first element of the input
        $command = $this->find($name);

        $this->runningCommand = $command;
        $exitCode = $this->doRunCommand($command, $input, $output);
        $this->runningCommand = null;

        return $exitCode;
    }
private function symfonyDoRun(InputInterface $input, OutputInterface $output, $default = 'list-commands')
    {
        if (true === $input->hasParameterOption(['--version', '-V'])) {
            $output->writeln($this->getLongVersion());

            return 0;
        }

        $name = $this->getCommandName($input);

        if (true === $input->hasParameterOption(['--help', '-h'])) {
            if (!$name) {
                $name = 'help';
                $input = new ArrayInput(['command' => 'help']);
            } else {
                // TODO $wantHelps is private in parent class
                $this->wantHelps = true;
            }
        }

        if (!$name) {
            $name = $default;
            $input = new ArrayInput(['command' => $default]);
        }

        // the command name MUST be the first element of the input
        $command = $this->find($name);

        $this->runningCommand = $command;
        $exitCode = $this->doRunCommand($command, $input, $output);
        $this->runningCommand = null;

        return $exitCode;
    }
private function symfonyDoRun ( InputInterface $ input , OutputInterface $ output , $ default = 'list-commands' ) { if ( true === $ input -> hasParameterOption ( [ '--version' , '-V' ] ) ) { $ output -> writeln ( $ this -> getLongVersion ( ) ) ; return 0 ; } $ name = $ this -> getCommandName ( $ input ) ; if ( true === $ input -> hasParameterOption ( [ '--help' , '-h' ] ) ) { if ( ! $ name ) { $ name = 'help' ; $ input = new ArrayInput ( [ 'command' => 'help' ] ) ; } else { // TODO $wantHelps is private in parent class $ this -> wantHelps = true ; } } if ( ! $ name ) { $ name = $ default ; $ input = new ArrayInput ( [ 'command' => $ default ] ) ; } // the command name MUST be the first element of the input $ command = $ this -> find ( $ name ) ; $ this -> runningCommand = $ command ; $ exitCode = $ this -> doRunCommand ( $ command , $ input , $ output ) ; $ this -> runningCommand = null ; return $ exitCode ; }
Copy of original Symfony doRun, to allow a default command

@param InputInterface  $input   An Input instance
@param OutputInterface $output  An Output instance
@param string          $default Default command to execute

@return int 0 if everything went fine, or an error code
@codeCoverageIgnore
Copy of original Symfony doRun to allow a default command