private function getExistingBundleHashes($baseDir)
    {
        $existingBundles = [];
        $fs = new Filesystem();
        $bundleBaseDir = $baseDir.self::BUNDLE_NAMESPACE;

        if (!$fs->exists($bundleBaseDir)) {
            return $existingBundles;
        }

        $bundleFinder = $this->getBundleFinder($baseDir);

        foreach ($bundleFinder as $bundleDir) {
            $genHash = '';
            $hashFileFinder = new Finder();
            $hashFileIterator = $hashFileFinder
                ->files()
                ->in($bundleDir->getPathname())
                ->name(self::GENERATION_HASHFILE_FILENAME)
                ->depth('== 0')
                ->getIterator();

            $hashFileIterator->rewind();

            $hashFile = $hashFileIterator->current();
            if ($hashFile instanceof SplFileInfo) {
                $genHash = $hashFile->getContents();
            }

            $existingBundles[$bundleDir->getPathname()] = $genHash;
        }

        return $existingBundles;
    }