Code Duplication    Length = 7-7 lines in 2 locations

lib/Doctrine/ODM/MongoDB/Mapping/Driver/YamlDriver.php 2 locations

@@ 208-214 (lines=7) @@
205
            $options = $mapping['index'];
206
        }
207
208
        if (isset($mapping['unique'])) {
209
            if (is_array($mapping['unique'])) {
210
                $options = $mapping['unique'] + array('unique' => true);
211
            } else {
212
                $unique = (boolean) $mapping['unique'];
213
            }
214
        }
215
216
        if (isset($mapping['sparse'])) {
217
            if (is_array($mapping['sparse'])) {
@@ 216-222 (lines=7) @@
213
            }
214
        }
215
216
        if (isset($mapping['sparse'])) {
217
            if (is_array($mapping['sparse'])) {
218
                $options = $mapping['sparse'] + array('sparse' => true);
219
            } else {
220
                $sparse = (boolean) $mapping['sparse'];
221
            }
222
        }
223
224
        if (isset($unique)) {
225
            $options['unique'] = $unique;