Code Duplication    Length = 7-7 lines in 2 locations

lib/Doctrine/ODM/MongoDB/Persisters/PersistenceBuilder.php 2 locations

@@ 130-136 (lines=7) @@
127
                if ($new === null && $mapping['nullable'] !== true) {
128
                    $updateData['$unset'][$mapping['name']] = true;
129
                } else {
130
                    if ($new !== null && isset($mapping['strategy']) && $mapping['strategy'] === ClassMetadataInfo::STORAGE_STRATEGY_INCREMENT) {
131
                        $operator = '$inc';
132
                        $value = Type::getType($mapping['type'])->convertToDatabaseValue($new - $old);
133
                    } else {
134
                        $operator = '$set';
135
                        $value = $new === null ? null : Type::getType($mapping['type'])->convertToDatabaseValue($new);
136
                    }
137
138
                    $updateData[$operator][$mapping['name']] = $value;
139
                }
@@ 228-234 (lines=7) @@
225
            // Scalar fields
226
            if ( ! isset($mapping['association'])) {
227
                if ($new !== null || $mapping['nullable'] === true) {
228
                    if ($new !== null && empty($mapping['id']) && isset($mapping['strategy']) && $mapping['strategy'] === ClassMetadataInfo::STORAGE_STRATEGY_INCREMENT) {
229
                        $operator = '$inc';
230
                        $value = Type::getType($mapping['type'])->convertToDatabaseValue($new - $old);
231
                    } else {
232
                        $operator = '$set';
233
                        $value = $new === null ? null : Type::getType($mapping['type'])->convertToDatabaseValue($new);
234
                    }
235
236
                    $updateData[$operator][$mapping['name']] = $value;
237
                }