Code Duplication    Length = 6-7 lines in 3 locations

lib/Doctrine/ODM/MongoDB/Mapping/Driver/XmlDriver.php 3 locations

@@ 254-259 (lines=6) @@
251
            $attr = $embed->{'discriminator-field'};
252
            $mapping['discriminatorField'] = (string) $attr['name'];
253
        }
254
        if (isset($embed->{'discriminator-map'})) {
255
            foreach ($embed->{'discriminator-map'}->{'discriminator-mapping'} as $discriminatorMapping) {
256
                $attr = $discriminatorMapping->attributes();
257
                $mapping['discriminatorMap'][(string) $attr['value']] = (string) $attr['class'];
258
            }
259
        }
260
        if (isset($embed->{'default-discriminator-value'})) {
261
            $mapping['defaultDiscriminatorValue'] = (string) $embed->{'default-discriminator-value'}['value'];
262
        }
@@ 304-309 (lines=6) @@
301
            $attr = $reference->{'discriminator-field'};
302
            $mapping['discriminatorField'] = (string) $attr['name'];
303
        }
304
        if (isset($reference->{'discriminator-map'})) {
305
            foreach ($reference->{'discriminator-map'}->{'discriminator-mapping'} as $discriminatorMapping) {
306
                $attr = $discriminatorMapping->attributes();
307
                $mapping['discriminatorMap'][(string) $attr['value']] = (string) $attr['class'];
308
            }
309
        }
310
        if (isset($reference->{'default-discriminator-value'})) {
311
            $mapping['defaultDiscriminatorValue'] = (string) $reference->{'default-discriminator-value'}['value'];
312
        }
@@ 103-109 (lines=7) @@
100
                isset($discrField['name']) ? (string) $discrField['name'] : (string) $discrField['fieldName']
101
            );
102
        }
103
        if (isset($xmlRoot->{'discriminator-map'})) {
104
            $map = array();
105
            foreach ($xmlRoot->{'discriminator-map'}->{'discriminator-mapping'} AS $discrMapElement) {
106
                $map[(string) $discrMapElement['value']] = (string) $discrMapElement['class'];
107
            }
108
            $class->setDiscriminatorMap($map);
109
        }
110
        if (isset($xmlRoot->{'default-discriminator-value'})) {
111
            $class->setDefaultDiscriminatorValue((string) $xmlRoot->{'default-discriminator-value'}['value']);
112
        }