| Conditions | 2 |
| Paths | 2 |
| Total Lines | 20 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 26 | protected function execute(InputInterface $input, OutputInterface $output): int |
||
| 27 | { |
||
| 28 | $this->initConfiguration($input->getOption('configFile')); |
||
| 29 | |||
| 30 | $commands = $this->config->getCommands(); |
||
| 31 | |||
| 32 | $id = $input->getArgument('commandId'); |
||
| 33 | |||
| 34 | if (!array_key_exists($id, $commands)) { |
||
| 35 | $output->writeln('The given id is not known.'); |
||
| 36 | return Command::FAILURE; |
||
| 37 | } |
||
| 38 | |||
| 39 | $this->config->removeCommand($id); |
||
| 40 | |||
| 41 | $this->getApplication()->find('collect')->run(new ArrayInput([]), new NullOutput()); |
||
| 42 | |||
| 43 | $output->writeln('<info>Command successfully removed</info>'); |
||
| 44 | |||
| 45 | return Command::SUCCESS; |
||
| 46 | } |
||
| 48 |