private function isEmptyDir($path) { if ($this->fs->exists($path) === true) { $finder = new Finder(); $finder->in($path); $iterator = $finder->getIterator(); $iterator->next(); return iterator_count($iterator) === 0; } return true; }