From 97eea76a1afedafff0941c032b6b11910a3e06b7 Mon Sep 17 00:00:00 2001 From: Dexter Marks-Barber Date: Fri, 29 Jun 2018 13:06:25 +0100 Subject: [PATCH] Update Module.php --- src/LangleyFoxall/Modules/Module.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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) {