public function execute(InputInterface $input, OutputInterface $output) { if (!in_array($input->getOption('adapter'), ['BitBucket', 'GitHub'])) { throw new InvalidArgumentException(sprintf('The given adapter "%s" is not supported (yet)', $input->getOption('adapter'))); } $guardian = new GitGuardian(); $adapter = 'GitHub' === $input->getOption('adapter') ? GitHubRemote::REMOTE_CANONICAL_NAME : BitBucketRemote::REMOTE_CANONICAL_NAME; $destination = $input->getOption('destination') . DIRECTORY_SEPARATOR . $adapter; $configLog = $guardian->getConfigLog($destination); switch ($input->getOption('format')) { case 'table': $this->dumpTableFormat($output, $configLog, $adapter); break; case 'table-compact': $this->dumpTableFormat($output, $configLog, $adapter, 'compact'); break; case 'table-borderless': $this->dumpTableFormat($output, $configLog, $adapter, 'borderless'); break; case 'csv': $this->dumpXsvFormat($configLog, $adapter); break; case 'tsv': $this->dumpXsvFormat($configLog, $adapter, "\t"); break; case 'json': $this->dumpJsonFormat($configLog, $adapter); break; case 'json-pretty': $this->dumpJsonFormat($configLog, $adapter, JSON_PRETTY_PRINT); break; default: throw new InvalidArgumentException(sprintf('The format "%s" is not supported', $input->getOption('format'))); } }