Conditions | 2 |
Paths | 2 |
Total Lines | 28 |
Code Lines | 20 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
39 | protected function execute(InputInterface $input, OutputInterface $output) |
||
40 | { |
||
41 | $Map = Mapping::fromYAML($input->getArgument('file')); |
||
42 | |||
43 | $io = new SymfonyStyle($input, $output); |
||
44 | $table = new Table($output); |
||
45 | $io->title('DBC Inspect'); |
||
46 | $io->section('Stats'); |
||
47 | $io->text([ |
||
48 | sprintf( |
||
49 | 'The mapping contains %u fields at %u bytes in total.', |
||
50 | $Map->getFieldCount(), |
||
51 | $Map->getFieldSize() |
||
52 | ), |
||
53 | '', |
||
54 | ]); |
||
55 | |||
56 | $io->newLine(); |
||
57 | |||
58 | $io->section('Fields'); |
||
59 | $table->setHeaders($Map->getFieldNames()); |
||
60 | $parsed_fields = $Map->getParsedFields(); |
||
61 | $field_types = []; |
||
62 | foreach ($parsed_fields as $field_name => $field_data) { |
||
63 | $field_types[] = $field_data['type']; |
||
64 | } |
||
65 | $table->addRow($field_types); |
||
66 | $table->render(); |
||
67 | } |
||
69 |