/** * Deletes a directory * * @param boolean $recursive * * @return boolean */ public function delete($recursive = false) { if (!$recursive) { return parent::delete(); } $finder = new Finder(); $contents = $finder->listContents($this->path); foreach ($contents as $item) { $item->delete(true); } return parent::delete(); }