| Conditions | 2 |
| Paths | 2 |
| Total Lines | 19 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 2 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 29 | 1 | public function create( |
|
| 30 | InputInterface $input, |
||
| 31 | OutputInterface $output |
||
| 32 | ): ViolationExporterInterface { |
||
| 33 | 1 | $format = $input->hasOption('format') |
|
| 34 | 1 | ? $input->getOption('format') |
|
| 35 | 1 | : static::DEFAULT_FORMAT; |
|
| 36 | |||
| 37 | $class = ( |
||
| 38 | 1 | static::EXPORTERS[$format] |
|
| 39 | 1 | ?? static::EXPORTERS[static::DEFAULT_FORMAT] |
|
| 40 | ); |
||
| 41 | |||
| 42 | /** @var ViolationExporterInterface $exporter */ |
||
| 43 | 1 | $exporter = new $class( |
|
| 44 | 1 | new SymfonyStyle($input, $output) |
|
| 45 | ); |
||
| 46 | |||
| 47 | 1 | return $exporter; |
|
| 48 | } |
||
| 60 |