public function removeDir($dirname) { if ($this->exists($dirname) && $this->isDir($dirname)) { $this->ensuredRemoveDir($dirname); return; } throw new WriteException("Directory {$dirname} could not be removed."); }