Code Duplication    Length = 7-7 lines in 2 locations

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

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