private function loadDoctrineClassMap(Finder $finder)
    {
        $classMap = [];
        foreach ($finder as $file) {
            $classMap = array_merge(
                $classMap,
                Yaml::parseFile($file)
            );
        }

        // filter out superclasses
        $classMap = array_filter(
            $classMap,
            function ($classEntry) {
                return (!isset($classEntry['type']) || $classEntry['type'] != 'mappedSuperclass');
            }
        );

        return $classMap;
    }