| Conditions | 3 |
| Paths | 3 |
| Total Lines | 18 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 3.6511 |
| Changes | 0 | ||
| 1 | <?php |
||
| 32 | 1 | protected function execute(InputInterface $input, OutputInterface $output): int |
|
| 33 | { |
||
| 34 | 1 | if (!$input->getOption('force')) { |
|
| 35 | $helper = $this->getHelper('question'); /** @var \Symfony\Component\Console\Helper\QuestionHelper $helper */ |
||
| 36 | $question = new ConfirmationQuestion('Do you want to delete all tasks from the queue? (y/f) ', false); |
||
| 37 | if (!$helper->ask($input, $output, $question)) { |
||
| 38 | $output->writeln('Canceled'); |
||
| 39 | return 0; |
||
| 40 | } |
||
| 41 | } |
||
| 42 | |||
| 43 | 1 | ServiceContainer::getInstance() |
|
| 44 | 1 | ->queue |
|
| 45 | 1 | ->flush(); |
|
| 46 | |||
| 47 | 1 | $this->formatInfoSection('Queue flushed', $output); |
|
| 48 | |||
| 49 | 1 | return 0; |
|
| 50 | } |
||
| 52 |