public function eraseDir($dirname = '') { if ($this->exists($dirname) && $this->isDir($dirname)) { $this->ensuredEraseDir($dirname); return; } throw new WriteException("Directory {$dirname} could not be erased."); }