Code Duplication    Length = 8-8 lines in 3 locations

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

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