diff --git a/src/LangleyFoxall/Modules/Module.php b/src/LangleyFoxall/Modules/Module.php index 3b211a4..1fc0d46 100644 --- a/src/LangleyFoxall/Modules/Module.php +++ b/src/LangleyFoxall/Modules/Module.php @@ -143,7 +143,8 @@ public function config() */ public function delete() { - $iterator = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($this->getPath(), FilesystemIterator::SKIP_DOTS), \RecursiveIteratorIterator::CHILD_FIRST); + $inner = new \RecursiveDirectoryIterator($this->getPath(), \FilesystemIterator::SKIP_DOTS); + $iterator = new \RecursiveIteratorIterator($inner, \RecursiveIteratorIterator::SELF_FIRST, \RecursiveIteratorIterator::CATCH_GET_CHILD); /** @var SplFileInfo $item */ foreach ($iterator as $item) {