original_string: public function exec($cmd)
      {
          if (trim($cmd)) {
              $this->setOutputPrefix('');
  
              if ($this->resolve('DEBUG')) {
                  $this->output->writeln('<comment># ' . join('::', Debug::$scope) . "</comment>");
              }
  
              if ($this->resolve('EXPLAIN')) {
                  if ($this->resolve('INTERACTIVE')) {
                      $this->notice('interactive shell:');
                      $line = '( /bin/bash -c \'' . trim($cmd) . '\' )';
                  } else {
                      $line = 'echo ' . escapeshellarg(trim($cmd)) . ' | ' . $this->resolve(array('SHELL'));
                  }
                  $this->output->writeln($line);
              } else {
                  $this->executor->execute($cmd);
              }
          }
      }
code: public function exec($cmd)
      {
          if (trim($cmd)) {
              $this->setOutputPrefix('');
  
              if ($this->resolve('DEBUG')) {
                  $this->output->writeln('<comment># ' . join('::', Debug::$scope) . "</comment>");
              }
  
              if ($this->resolve('EXPLAIN')) {
                  if ($this->resolve('INTERACTIVE')) {
                      $this->notice('interactive shell:');
                      $line = '( /bin/bash -c \'' . trim($cmd) . '\' )';
                  } else {
                      $line = 'echo ' . escapeshellarg(trim($cmd)) . ' | ' . $this->resolve(array('SHELL'));
                  }
                  $this->output->writeln($line);
              } else {
                  $this->executor->execute($cmd);
              }
          }
      }
code_tokens: public function exec ( $ cmd ) { if ( trim ( $ cmd ) ) { $ this -> setOutputPrefix ( '' ) ; if ( $ this -> resolve ( 'DEBUG' ) ) { $ this -> output -> writeln ( '<comment># ' . join ( '::' , Debug :: $ scope ) . "</comment>" ) ; } if ( $ this -> resolve ( 'EXPLAIN' ) ) { if ( $ this -> resolve ( 'INTERACTIVE' ) ) { $ this -> notice ( 'interactive shell:' ) ; $ line = '( /bin/bash -c \'' . trim ( $ cmd ) . '\' )' ; } else { $ line = 'echo ' . escapeshellarg ( trim ( $ cmd ) ) . ' | ' . $ this -> resolve ( array ( 'SHELL' ) ) ; } $ this -> output -> writeln ( $ line ) ; } else { $ this -> executor -> execute ( $ cmd ) ; } } }
docstring: Executes a script snippet using the 'executor' service.
  
  @param string $cmd
  @return void
docstring_tokens: Executes a script snippet using the executor service .