Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Filesystem.php

function Filesystem::isDirEmpty

Checks if a directory is empty

Return value

bool

File

vendor/composer/composer/src/Composer/Util/Filesystem.php, line 58

Class

Filesystem
@author Jordi Boggiano <j.boggiano@seld.be> @author Johannes M. Schmitt <schmittjoh@gmail.com>

Namespace

Composer\Util

Code

public function isDirEmpty(string $dir) {
    $finder = Finder::create()->ignoreVCS(false)
        ->ignoreDotFiles(false)
        ->depth(0)
        ->in($dir);
    return \count($finder) === 0;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal