protected function isFolderEmpty($path) { $files = $this->getStorage()->files($path); $folders = $this->getStorage()->directories($path); return count($files) === 0 && count($folders) === 0; }