public function delete($path) { $result = parent::delete($path); if ($this->shouldRemoveEmptyDir()) { $location = $this->applyPathPrefix($path); $directory = dirname($location); $this->removeDirectoryIfEmpty($directory, true); } return $result; }