Code Duplication    Length = 15-16 lines in 2 locations

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

@@ 1108-1122 (lines=15) @@
1105
     * @param array $documents Array of documents to insert
1106
     * @param array $options Array of options to be used with batchInsert()
1107
     */
1108
    private function executeInserts(ClassMetadata $class, array $documents, array $options = array())
1109
    {
1110
        $persister = $this->getDocumentPersister($class->name);
1111
1112
        foreach ($documents as $oid => $document) {
1113
            $persister->addInsert($document);
1114
            unset($this->documentInsertions[$oid]);
1115
        }
1116
1117
        $persister->executeInserts($options);
1118
1119
        foreach ($documents as $document) {
1120
            $this->lifecycleEventManager->postPersist($class, $document);
1121
        }
1122
    }
1123
1124
    /**
1125
     * Executes all document upserts for documents of the specified type.
@@ 1131-1146 (lines=16) @@
1128
     * @param array $documents Array of documents to upsert
1129
     * @param array $options Array of options to be used with batchInsert()
1130
     */
1131
    private function executeUpserts(ClassMetadata $class, array $documents, array $options = array())
1132
    {
1133
        $persister = $this->getDocumentPersister($class->name);
1134
1135
1136
        foreach ($documents as $oid => $document) {
1137
            $persister->addUpsert($document);
1138
            unset($this->documentUpserts[$oid]);
1139
        }
1140
1141
        $persister->executeUpserts($options);
1142
1143
        foreach ($documents as $document) {
1144
            $this->lifecycleEventManager->postPersist($class, $document);
1145
        }
1146
    }
1147
1148
    /**
1149
     * Executes all document updates for documents of the specified type.