diff --git a/module/CLI/src/Command/Tag/ListTagsCommand.php b/module/CLI/src/Command/Tag/ListTagsCommand.php index 0474fc97..ea860900 100644 --- a/module/CLI/src/Command/Tag/ListTagsCommand.php +++ b/module/CLI/src/Command/Tag/ListTagsCommand.php @@ -6,9 +6,9 @@ namespace Shlinkio\Shlink\CLI\Command\Tag; use Shlinkio\Shlink\Core\Entity\Tag; use Shlinkio\Shlink\Core\Service\Tag\TagServiceInterface; use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Helper\Table; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Console\Style\SymfonyStyle; use Zend\I18n\Translator\TranslatorInterface; class ListTagsCommand extends Command @@ -40,11 +40,8 @@ class ListTagsCommand extends Command protected function execute(InputInterface $input, OutputInterface $output) { - $table = new Table($output); - $table->setHeaders([$this->translator->translate('Name')]) - ->setRows($this->getTagsRows()); - - $table->render(); + $io = new SymfonyStyle($input, $output); + $io->table([$this->translator->translate('Name')], $this->getTagsRows()); } private function getTagsRows() @@ -54,7 +51,7 @@ class ListTagsCommand extends Command return [[$this->translator->translate('No tags yet')]]; } - return array_map(function (Tag $tag) { + return \array_map(function (Tag $tag) { return [$tag->getName()]; }, $tags); }