original_string: public function execute($cmd, &$captureOutput = null)
      {
          $isInteractive = $this->container->get('INTERACTIVE');
          $process = $this->createProcess($isInteractive);
  
          if ($isInteractive) {
              $process->setCommandLine(sprintf('/bin/bash -c \'%s\'', $cmd));
          } else {
              $process->setInput($cmd);
          }
  
          if (null !== $captureOutput && false === $isInteractive) {
              $process->run(function ($type, $data) use(&$captureOutput) {
                  $captureOutput .= $data;
              });
          } else {
              $process->run(array($this, 'processCallback'));
          }
  
          $ret = $process->getExitCode();
  
          if ($ret != 0) {
              if ((int)$ret == Container::ABORT_EXIT_CODE) {
                  throw new ExecutionAbortedException("Command '$cmd' was aborted");
              } else {
                  throw new \UnexpectedValueException("Command '$cmd' failed with exit code {$ret}");
              }
          }
          return $ret;
      }
code: public function execute($cmd, &$captureOutput = null)
      {
          $isInteractive = $this->container->get('INTERACTIVE');
          $process = $this->createProcess($isInteractive);
  
          if ($isInteractive) {
              $process->setCommandLine(sprintf('/bin/bash -c \'%s\'', $cmd));
          } else {
              $process->setInput($cmd);
          }
  
          if (null !== $captureOutput && false === $isInteractive) {
              $process->run(function ($type, $data) use(&$captureOutput) {
                  $captureOutput .= $data;
              });
          } else {
              $process->run(array($this, 'processCallback'));
          }
  
          $ret = $process->getExitCode();
  
          if ($ret != 0) {
              if ((int)$ret == Container::ABORT_EXIT_CODE) {
                  throw new ExecutionAbortedException("Command '$cmd' was aborted");
              } else {
                  throw new \UnexpectedValueException("Command '$cmd' failed with exit code {$ret}");
              }
          }
          return $ret;
      }
code_tokens: public function execute ( $ cmd , & $ captureOutput = null ) { $ isInteractive = $ this -> container -> get ( 'INTERACTIVE' ) ; $ process = $ this -> createProcess ( $ isInteractive ) ; if ( $ isInteractive ) { $ process -> setCommandLine ( sprintf ( '/bin/bash -c \'%s\'' , $ cmd ) ) ; } else { $ process -> setInput ( $ cmd ) ; } if ( null !== $ captureOutput && false === $ isInteractive ) { $ process -> run ( function ( $ type , $ data ) use ( & $ captureOutput ) { $ captureOutput .= $ data ; } ) ; } else { $ process -> run ( array ( $ this , 'processCallback' ) ) ; } $ ret = $ process -> getExitCode ( ) ; if ( $ ret != 0 ) { if ( ( int ) $ ret == Container :: ABORT_EXIT_CODE ) { throw new ExecutionAbortedException ( "Command '$cmd' was aborted" ) ; } else { throw new \ UnexpectedValueException ( "Command '$cmd' failed with exit code {$ret}" ) ; } } return $ ret ; }
docstring: Executes the passed command line in the shell.
  
  @param string $cmd
  @param null &$captureOutput
  @param string $captureOutput
  @return int
  
  @throws ExecutionAbortedException
  @throws \UnexpectedValueException
docstring_tokens: Executes the passed command line in the shell .