Code Duplication    Length = 15-16 lines in 2 locations

lib/Doctrine/ODM/MongoDB/UnitOfWork.php 2 locations

@@ 1121-1135 (lines=15) @@
1118
     * @param array $documents Array of documents to insert
1119
     * @param array $options Array of options to be used with batchInsert()
1120
     */
1121
    private function executeInserts(ClassMetadata $class, array $documents, array $options = array())
1122
    {
1123
        $persister = $this->getDocumentPersister($class->name);
1124
1125
        foreach ($documents as $oid => $document) {
1126
            $persister->addInsert($document);
1127
            unset($this->documentInsertions[$oid]);
1128
        }
1129
1130
        $persister->executeInserts($options);
1131
1132
        foreach ($documents as $document) {
1133
            $this->lifecycleEventManager->postPersist($class, $document);
1134
        }
1135
    }
1136
1137
    /**
1138
     * Executes all document upserts for documents of the specified type.
@@ 1144-1159 (lines=16) @@
1141
     * @param array $documents Array of documents to upsert
1142
     * @param array $options Array of options to be used with batchInsert()
1143
     */
1144
    private function executeUpserts(ClassMetadata $class, array $documents, array $options = array())
1145
    {
1146
        $persister = $this->getDocumentPersister($class->name);
1147
1148
1149
        foreach ($documents as $oid => $document) {
1150
            $persister->addUpsert($document);
1151
            unset($this->documentUpserts[$oid]);
1152
        }
1153
1154
        $persister->executeUpserts($options);
1155
1156
        foreach ($documents as $document) {
1157
            $this->lifecycleEventManager->postPersist($class, $document);
1158
        }
1159
    }
1160
1161
    /**
1162
     * Executes all document updates for documents of the specified type.