protected function processDiscriminatorMap(ClassMetadataInfo $metadata)
    {
        $newMap = [];

        foreach ($metadata->discriminatorMap as $mapId => $mappedEntityName) {
            $newKey = $this->doReplacement($mapId);
            $newMap[$newKey] = $mappedEntityName;
        }

        $metadata->discriminatorMap = $newMap;
    }