Code Duplication    Length = 7-9 lines in 2 locations

ODM/MongoDB/Metadata/Driver/XmlDriver.php 2 locations

@@ 59-65 (lines=7) @@
56
            );
57
58
            if ($field->getName() == 'field') {
59
                if (isset($fieldMapping['id']) && $fieldMapping['id'] !== false) {
60
                    throw MappingException::inField(
61
                        'The cubiche:collection configuration is only for field tags that is not an id',
62
                        $classMetadata->name,
63
                        $fieldName
64
                    );
65
                }
66
67
                if (!isset($fieldMapping['type']) ||
68
                    (isset($fieldMapping['type']) && $fieldMapping['type'] !== 'CubicheType')
@@ 87-95 (lines=9) @@
84
85
                $classMetadata->addPropertyMetadata($propertyMetadata);
86
            } elseif ($field->getName() == 'embed-many' || $field->getName() == 'reference-many') {
87
                if (isset($fieldMapping['field'])) {
88
                    $field = $fieldMapping['field'];
89
                } else {
90
                    throw MappingException::inField(
91
                        'Cannot infer a field',
92
                        $classMetadata->name,
93
                        $fieldName
94
                    );
95
                }
96
97
                $propertyMetadata = new PropertyMetadata($classMetadata->name, $field);
98