9 use Symfony\Component\Console\Helper\TableFactory;
10 use Symfony\Component\Console\Input\InputInterface;
11 use Symfony\Component\Console\Output\OutputInterface;
12 use Symfony\Component\Console\Command\Command;
31 private $tableHelperFactory;
39 $this->lists = $lists;
41 parent::__construct();
49 $this->setName(
'info:currency:list')
50 ->setDescription(
'Displays the list of available currencies');
60 $tableHelper = $this->tableHelperFactory->create([
'output' =>
$output]);
61 $tableHelper->setHeaders([
'Currency',
'Code']);
63 foreach ($this->lists->getCurrencyList() as $key => $currency) {
64 $tableHelper->addRow([$currency, $key]);
67 $tableHelper->render();
68 return \Magento\Framework\Console\Cli::RETURN_SUCCESS;
execute(InputInterface $input, OutputInterface $output)
__construct(Lists $lists, TableFactory $tableHelperFactory=null)