setDescription('List cronjobs.'); $this->setHelp('This command lists all available cronjobs.'); } protected function execute(InputInterface $input, OutputInterface $output): int { $tasks = \CronjobTask::findBySql('1'); if ($tasks) { $table = new Table($output); $table->setStyle('compact'); $table->setHeaders(['Task-ID', 'Description']); foreach ($tasks as $task) { if (!$task->valid) { continue; } $description = call_user_func(['\\' . $task->class, 'getDescription']); if ($description) { $table->addRow([$task->id, $description]); } } $table->render(); } return Command::SUCCESS; } }