Code Duplication    Length = 15-16 lines in 2 locations

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

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