| Conditions | 1 |
| Paths | 1 |
| Total Lines | 16 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 32 | public function execute(InputInterface $input, OutputInterface $output) |
||
| 33 | { |
||
| 34 | $nationalityService = $this->getChina()->getNationality(); |
||
| 35 | $style = new SymfonyStyle($input, $output); |
||
| 36 | $headers = ['名称', '拼音', '人口']; |
||
| 37 | |||
| 38 | $nationalities = $nationalityService->findAll()->toArray(); |
||
| 39 | $rows = array_map(function(NationalityInterface $nationality){ |
||
| 40 | return [ |
||
| 41 | "<info>{$nationality->getName()}</info>", |
||
| 42 | $nationality->getPinyin(), |
||
| 43 | $nationality->getPopulation(), |
||
| 44 | ]; |
||
| 45 | }, $nationalities); |
||
| 46 | $style->table($headers, $rows); |
||
| 47 | } |
||
| 48 | } |