Code Duplication    Length = 7-7 lines in 2 locations

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

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