LEtudiant\Composer\Util\SymlinkFilesystem::removeEmptyDirectory PHP Method

removeEmptyDirectory() public method

public removeEmptyDirectory ( string $directoryPath ) : boolean
$directoryPath string
return boolean
    public function removeEmptyDirectory($directoryPath)
    {
        if (is_dir($directoryPath) && $this->isDirEmpty($directoryPath)) {
            if (!$this->removeDirectory($directoryPath)) {
                // @codeCoverageIgnoreStart
                throw new \RuntimeException('Unable to remove the directory : ' . $directoryPath);
                // @codeCoverageIgnoreEnd
            }
            return true;
        }
        return false;
    }

Usage Example

 /**
  * @param PackageInterface $package
  *
  * @throws FilesystemException
  */
 protected function removePackageVendorSymlink(PackageInterface $package)
 {
     if ($this->config->isSymlinkEnabled() && $this->filesystem->removeSymlink($this->getPackageVendorSymlink($package))) {
         $this->io->write(array('  - Deleting symlink for <info>' . $package->getPrettyName() . '</info> ' . '(<fg=yellow>' . $package->getPrettyVersion() . '</fg=yellow>)', ''));
         $symlinkParentDirectory = dirname($this->getPackageVendorSymlink($package));
         $this->filesystem->removeEmptyDirectory($symlinkParentDirectory);
     }
 }
All Usage Examples Of LEtudiant\Composer\Util\SymlinkFilesystem::removeEmptyDirectory