| Conditions | 4 |
| Paths | 4 |
| Total Lines | 22 |
| Code Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 1 | Features | 0 |
| 1 | <?php declare(strict_types=1); |
||
| 10 | protected function removeDirectoryRecursive($directory) |
||
| 11 | { |
||
| 12 | if (\is_dir($directory)) { |
||
| 13 | $recursiveDirectoryIterator = new \RecursiveDirectoryIterator( |
||
| 14 | $directory, |
||
| 15 | \RecursiveDirectoryIterator::SKIP_DOTS |
||
| 16 | ); |
||
| 17 | |||
| 18 | $files = new \RecursiveIteratorIterator( |
||
| 19 | $recursiveDirectoryIterator, |
||
| 20 | \RecursiveIteratorIterator::CHILD_FIRST |
||
| 21 | ); |
||
| 22 | |||
| 23 | foreach ($files as $file) { |
||
| 24 | if ($file->isDir()) { |
||
| 25 | \rmdir($file->getRealPath()); |
||
| 26 | } else { |
||
| 27 | \unlink($file->getRealPath()); |
||
| 28 | } |
||
| 29 | } |
||
| 30 | |||
| 31 | \rmdir($directory); |
||
| 32 | } |
||
| 61 |