Code Duplication    Length = 7-7 lines in 2 locations

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

@@ 225-231 (lines=7) @@
222
            $options = $mapping['index'];
223
        }
224
225
        if (isset($mapping['unique'])) {
226
            if (is_array($mapping['unique'])) {
227
                $options = $mapping['unique'] + array('unique' => true);
228
            } else {
229
                $unique = (boolean) $mapping['unique'];
230
            }
231
        }
232
233
        if (isset($mapping['sparse'])) {
234
            if (is_array($mapping['sparse'])) {
@@ 233-239 (lines=7) @@
230
            }
231
        }
232
233
        if (isset($mapping['sparse'])) {
234
            if (is_array($mapping['sparse'])) {
235
                $options = $mapping['sparse'] + array('sparse' => true);
236
            } else {
237
                $sparse = (boolean) $mapping['sparse'];
238
            }
239
        }
240
241
        if (isset($unique)) {
242
            $options['unique'] = $unique;