| Conditions | 3 |
| Paths | 3 |
| Total Lines | 18 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 46 | protected function execute(InputInterface $input, OutputInterface $output) |
||
| 47 | { |
||
| 48 | $service_name = $input->getArgument('service'); |
||
| 49 | if (!$this->getContainer()->has($service_name)) { |
||
| 50 | $output->writeln(sprintf('<error>The service "%s" does not exist.</error>', $service_name)); |
||
| 51 | |||
| 52 | return 1; |
||
| 53 | } |
||
| 54 | $service = $this->getContainer()->get($service_name); |
||
| 55 | if (!$service instanceof StorableInterface) { |
||
| 56 | $output->writeln(sprintf('<error>The service "%s" is not a storable object.</error>', $service_name)); |
||
| 57 | |||
| 58 | return 2; |
||
| 59 | } |
||
| 60 | |||
| 61 | $service->delete(); |
||
| 62 | $output->writeln('Done.'); |
||
| 63 | } |
||
| 64 | } |
||
| 65 |