Code Duplication    Length = 11-12 lines in 2 locations

bridge/doctrine-phpcr-odm/src/FieldMapper.php 2 locations

@@ 108-119 (lines=12) @@
105
            return;
106
        }
107
108
        if ($type === Type\ReferenceType::class) {
109
            $metadata->mapManyToOne([
110
                'fieldName' => $fieldName,
111
                'strategy' => 'hard',
112
113
                'nullable' => true,
114
                'cascade' => ClassMetadata::CASCADE_ALL,
115
                'multivalue' => $options['multivalue'],
116
            ]);
117
118
            return;
119
        }
120
121
        throw new \RuntimeException(sprintf(
122
            'Do not know how to map field of type "%s"',
@@ 147-157 (lines=11) @@
144
            return;
145
        }
146
147
        if ($collectionField->getStorageType() === Type\ReferenceType::class) {
148
            $metadata->mapManyToMany([
149
                'fieldName' => $fieldName,
150
                'strategy' => 'hard',
151
152
                'nullable' => true,
153
                'cascade' => ClassMetadata::CASCADE_ALL,
154
            ]);
155
156
            return;
157
        }
158
159
        // assume that other types are scalars...
160
        $this->__invoke($fieldName, $collectionField, $metadata, [