Code Duplication    Length = 7-7 lines in 2 locations

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

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