Code Duplication    Length = 15-16 lines in 2 locations

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

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