Code Duplication    Length = 8-8 lines in 3 locations

lib/Doctrine/ODM/MongoDB/SchemaManager.php 3 locations

@@ 267-274 (lines=8) @@
264
     * @param string $documentName
265
     * @throws \InvalidArgumentException
266
     */
267
    public function deleteDocumentIndexes($documentName)
268
    {
269
        $class = $this->dm->getClassMetadata($documentName);
270
        if ($class->isMappedSuperclass || $class->isEmbeddedDocument || $class->isQueryResultDocument) {
271
            throw new \InvalidArgumentException('Cannot delete document indexes for mapped super classes, embedded documents or query result documents.');
272
        }
273
        $this->dm->getDocumentCollection($documentName)->dropIndexes();
274
    }
275
276
    /**
277
     * Create all the mapped document collections in the metadata factory.
@@ 332-339 (lines=8) @@
329
     * @param string $documentName
330
     * @throws \InvalidArgumentException
331
     */
332
    public function dropDocumentCollection($documentName)
333
    {
334
        $class = $this->dm->getClassMetadata($documentName);
335
        if ($class->isMappedSuperclass || $class->isEmbeddedDocument || $class->isQueryResultDocument) {
336
            throw new \InvalidArgumentException('Cannot delete document indexes for mapped super classes, embedded documents or query result documents.');
337
        }
338
        $this->dm->getDocumentCollection($documentName)->drop();
339
    }
340
341
    /**
342
     * Drop all the mapped document databases in the metadata factory.
@@ 360-367 (lines=8) @@
357
     * @param string $documentName
358
     * @throws \InvalidArgumentException
359
     */
360
    public function dropDocumentDatabase($documentName)
361
    {
362
        $class = $this->dm->getClassMetadata($documentName);
363
        if ($class->isMappedSuperclass || $class->isEmbeddedDocument || $class->isQueryResultDocument) {
364
            throw new \InvalidArgumentException('Cannot drop document database for mapped super classes, embedded documents or query result documents.');
365
        }
366
        $this->dm->getDocumentDatabase($documentName)->drop();
367
    }
368
369
    /**
370
     * Determine if an index returned by MongoCollection::getIndexInfo() can be