Example #1
0
 /**
  * {@inheritdoc}
  */
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $this->validateInput($input);
     $this->initEnumerators();
     $method = $input->getOption('long') ? 'writeLong' : 'write';
     if ($target = $input->getArgument('target')) {
         list($target, $reflector) = $this->getTargetAndReflector($target, true);
     } else {
         $reflector = null;
     }
     // TODO: something cleaner than this :-/
     if ($input->getOption('long')) {
         $output->startPaging();
     }
     foreach ($this->enumerators as $enumerator) {
         $this->{$method}($output, $enumerator->enumerate($input, $reflector, $target));
     }
     if ($input->getOption('long')) {
         $output->stopPaging();
     }
 }