private function removeEmptyDirectories($pathname, $root)
    {
        if (is_dir($pathname)
            && $pathname !== $root
            && $this->filesystem->isDirEmpty($pathname)
        ) {
            $this->filesystem->removeDirectory($pathname);

            if (!$this->removeEmptyDirectories(dirname($pathname), $root)) {
                if ($this->io->isVeryVerbose()) {
                    $this->io->writeError(sprintf('  - Removing empty directory "%s"', $pathname));
                }
            }

            return true;
        }

        return false;
    }
private function removeEmptyDirectories($pathname, $root)
    {
        if (is_dir($pathname)
            && $pathname !== $root
            && $this->filesystem->isDirEmpty($pathname)
        ) {
            $this->filesystem->removeDirectory($pathname);

            if (!$this->removeEmptyDirectories(dirname($pathname), $root)) {
                if ($this->io->isVeryVerbose()) {
                    $this->io->writeError(sprintf('  - Removing empty directory "%s"', $pathname));
                }
            }

            return true;
        }

        return false;
    }
private function removeEmptyDirectories ( $ pathname , $ root ) { if ( is_dir ( $ pathname ) && $ pathname !== $ root && $ this -> filesystem -> isDirEmpty ( $ pathname ) ) { $ this -> filesystem -> removeDirectory ( $ pathname ) ; if ( ! $ this -> removeEmptyDirectories ( dirname ( $ pathname ) , $ root ) ) { if ( $ this -> io -> isVeryVerbose ( ) ) { $ this -> io -> writeError ( sprintf ( '  - Removing empty directory "%s"' , $ pathname ) ) ; } } return true ; } return false ; }
Clean up empty directories.

@param string $pathname The path to remove if empty.
@param string $root     The path of the root installation.

@return bool
Clean up empty directories .