setDescription('List tasks'); return $this; } public function requireSetup() { return true; } public function execute(InputInterface $input, OutputInterface $output) { try{ $this->checkSetup(); } catch (\RuntimeException $e){ return self::EXITCODE_SETUP_ERROR; } try { $appbox = appbox::get_instance(\bootstrap::getCore()); $task_manager = new task_manager($appbox); $tasks = $task_manager->getTasks(); if (count($tasks) === 0) { $output->writeln('No tasks on your install !'); } foreach ($tasks as $task) { $this->printTask($task, $output); } return 0; } catch (\Exception $e) { return 1; } } protected function printTask(task_abstract $task, OutputInterface &$output) { $message = $task->getID() . "\t" . ($task->getState() ) . "\t" . $task->getTitle(); $output->writeln($message); return $this; } }