/**
  * Execute the Command.
  *
  * @param $input InputInterface
  * @param $output OutputInterface
  */
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     if ($input->getOption('list-info-collectors')) {
         $output->writeln('Available info collectors:', true);
         foreach ($this->systemInfoCollectorRegistry->getIdentifiers() as $identifier) {
             $output->writeln("  {$identifier}", true);
         }
         return;
     }
     $outputFormatter = $this->outputFormatRegistry->getItem($input->getOption('format'));
     if ($input->getArgument('info-collectors')) {
         $identifiers = $input->getArgument('info-collectors');
     } else {
         $identifiers = $this->systemInfoCollectorRegistry->getIdentifiers();
     }
     // Collect info for the given identifiers.
     $collectedInfoArray = [];
     foreach ($identifiers as $identifier) {
         $collectedInfoArray[$identifier] = $this->systemInfoCollectorRegistry->getItem($identifier)->collect();
     }
     $output->writeln($outputFormatter->format($collectedInfoArray));
 }
 /**
  * @param string $identifier A SystemInfo collector identifier (php, hardware...)
  *
  * @return \EzSystems\EzSupportToolsBundle\SystemInfo\Collector\SystemInfoCollector
  */
 private function getCollector($identifier)
 {
     return $this->registry->getItem($identifier);
 }