setName('mautic:segments:stat') ->setDescription('Gather Segment Statistics'); parent::configure(); } /** * {@inheritdoc} */ protected function execute(InputInterface $input, OutputInterface $output): int { $io = new SymfonyStyle($input, $output); $event = new GetStatDataEvent(); $this->dispatcher->dispatch($event); if (empty($event->getResults())) { $io->write('There is no segment to show!!'); } else { $io->table([ 'Title', 'Id', 'IsPublished', 'IsUsed', ], $event->getResults() ); } return Command::SUCCESS; } }