| Conditions | 5 |
| Paths | 5 |
| Total Lines | 31 |
| Code Lines | 18 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 11 |
| CRAP Score | 6.8667 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 32 | 2 | protected function execute(InputInterface $input, OutputInterface $output): ?int |
|
| 33 | { |
||
| 34 | 2 | foreach (['config_cache_path', 'cli_config_cache_path'] as $key) { |
|
| 35 | 2 | if (! isset($this->config[$key])) { |
|
| 36 | 1 | $output->writeln("<comment>No configuration cache path found</comment>"); |
|
| 37 | 1 | continue; |
|
| 38 | } |
||
| 39 | |||
| 40 | 1 | if (! file_exists($this->config[$key])) { |
|
| 41 | 1 | $output->writeln(sprintf( |
|
| 42 | 1 | "<error>Configured config cache file '%s' not found</error>", |
|
| 43 | 1 | $this->config[$key] |
|
| 44 | )); |
||
| 45 | 1 | continue; |
|
| 46 | } |
||
| 47 | |||
| 48 | if (false === unlink($this->config[$key])) { |
||
| 49 | $output->writeln(sprintf( |
||
| 50 | "<error>Error removing config cache file '%s'</error>", |
||
| 51 | $this->config[$key] |
||
| 52 | )); |
||
| 53 | continue; |
||
| 54 | } |
||
| 55 | |||
| 56 | $output->writeln(sprintf( |
||
| 57 | "<info>Removed configured config cache file '%s'</info>", |
||
| 58 | $this->config[$key] |
||
| 59 | )); |
||
| 60 | } |
||
| 61 | |||
| 62 | 2 | return 0; |
|
| 63 | } |
||
| 65 |