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