ApiGen\Utils\FileSystem::isDirEmpty PHP Метод

isDirEmpty() публичный метод

public isDirEmpty ( string $path ) : boolean
$path string
Результат boolean
    public function isDirEmpty($path)
    {
        if (count(glob($path . '/*'))) {
            return false;
        }
        return true;
    }

Usage Example

Пример #1
0
 /**
  * @param string $destination
  */
 private function cleanDestinationWithCaution($destination)
 {
     if (!$this->fileSystem->isDirEmpty($destination)) {
         if ($this->io->ask('<warning>Destination is not empty. Do you want to erase it?</warning>', true)) {
             $this->fileSystem->purgeDir($destination);
         }
     }
 }