| Conditions | 3 |
| Paths | 3 |
| Total Lines | 29 |
| Code Lines | 18 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 14 |
| CRAP Score | 3.0494 |
| Changes | 3 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 33 | 2 | protected function execute(InputInterface $input, OutputInterface $output) |
|
| 34 | { |
||
| 35 | 2 | $comodoDecodeCSR = new ComodoDecodeCSR(); |
|
| 36 | |||
| 37 | try { |
||
| 38 | 2 | $comodoDecodeCSR->setCSR($this->loadCSR($input, $output)); |
|
| 39 | 2 | } catch (Exception $e) { |
|
| 40 | 1 | $output->writeln('<error>Error!</error>'); |
|
| 41 | 1 | $output->writeln('Invalid CSR'); |
|
| 42 | |||
| 43 | 1 | return 3; |
|
| 44 | } |
||
| 45 | |||
| 46 | 1 | $hashes = $comodoDecodeCSR->fetchHashes(); |
|
| 47 | |||
| 48 | 1 | if (!$hashes) { |
|
| 49 | $output->writeln('<error>Fail!</error>'); |
||
| 50 | $output->writeln('Unable to fetch hashes'); |
||
| 51 | |||
| 52 | return 2; |
||
| 53 | } |
||
| 54 | |||
| 55 | 1 | $output->writeln('<info>Filename:</info> ' . $hashes['md5'] . '.txt'); |
|
| 56 | 1 | $output->writeln('<info>Contents:</info>'); |
|
| 57 | 1 | $output->writeln($comodoDecodeCSR->generateDVC()); |
|
| 58 | 1 | $output->writeln('<info>URL:</info> http://' . $comodoDecodeCSR->getCN() . '/' . $hashes['md5'] . '.txt'); |
|
| 59 | |||
| 60 | 1 | return 0; |
|
| 61 | } |
||
| 62 | } |
||
| 63 |