| Conditions | 5 |
| Paths | 5 |
| Total Lines | 17 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 35 | protected function execute(InputInterface $input, OutputInterface $output) |
||
| 36 | { |
||
| 37 | $dir = $input->getArgument('dir'); |
||
| 38 | $file = \realpath(sprintf('%s/manifest.json', $dir)); |
||
|
|
|||
| 39 | |||
| 40 | if (!\is_file($file)) { |
||
| 41 | return ; |
||
| 42 | } |
||
| 43 | |||
| 44 | $files = array_keys(json_decode(file_get_contents($file) ?? '[]', true)); |
||
| 45 | foreach (scandir($dir) as $file) { |
||
| 46 | if ('.' === $file[0]) { |
||
| 47 | continue; |
||
| 48 | } |
||
| 49 | |||
| 50 | if (!\in_array($file, $files)) { |
||
| 51 | unlink($file); |
||
| 52 | } |
||
| 56 |