| Conditions | 3 |
| Paths | 3 |
| Total Lines | 18 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 12 |
| CRAP Score | 3 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 35 | 4 | protected function execute(InputInterface $input, OutputInterface $output) |
|
| 36 | { |
||
| 37 | 4 | $commander = $this->getCommander()->initialize(); |
|
| 38 | 4 | $taskManager = $commander->getTaskManager(); |
|
| 39 | |||
| 40 | 4 | $tasks = $taskManager->findAllTerminatedTasks(); |
|
| 41 | |||
| 42 | 4 | if (0 === count($tasks)) { |
|
| 43 | 2 | $output->writeln('No tasks found'); |
|
| 44 | 2 | return; |
|
| 45 | } |
||
| 46 | |||
| 47 | 2 | foreach ($tasks as $task) { |
|
| 48 | 2 | $task->remove(); |
|
| 49 | 1 | } |
|
| 50 | |||
| 51 | 2 | $output->writeln(sprintf('Removed %s terminated task(s)', count($tasks))); |
|
| 52 | 2 | } |
|
| 53 | } |
||
| 54 |