Example #1
0
 /**
  * Hijack execute to turn off quiet
  *
  * @param \Symfony\Component\Console\Input\InputInterface   $input
  * @param \Symfony\Component\Console\Output\OutputInterface $output
  *
  * @return mixed
  */
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     //  No being quiet allowed...
     if (true === ($this->wasQuiet = OutputInterface::VERBOSITY_QUIET === $output->getVerbosity())) {
         $output->setVerbosity(OutputInterface::VERBOSITY_NORMAL);
     }
     //  Get the output format, if any
     if ($input->hasOption('format')) {
         if (empty($this->format = strtolower(trim($this->option('format'))))) {
             $this->format = null;
         }
     }
     //  No header when quiet or formatted data output...
     if (null === $this->format && !$this->wasQuiet) {
         $this->writeHeader();
     }
     //  Do the execute
     $_result = parent::execute($input, $output);
     //  Restore verbosity and return
     $this->wasQuiet && $output->setVerbosity(OutputInterface::VERBOSITY_NORMAL);
     return $_result;
 }
Example #2
0
 /**
  * Execute the console command.
  *
  * @param  \Symfony\Component\Console\Input\InputInterface  $input
  * @param  \Symfony\Component\Console\Output\OutputInterface  $output
  *
  * @return mixed
  */
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $result = parent::execute($input, $output);
     $this->finish();
     return $result;
 }