Code Duplication    Length = 13-13 lines in 2 locations

lib/Mongo/MongoDB.php 1 location

@@ 485-497 (lines=13) @@
482
    /**
483
     * @return \MongoDB\Database
484
     */
485
    private function createDatabaseObject()
486
    {
487
        $options = [
488
            'readPreference' => $this->readPreference,
489
            'writeConcern' => $this->writeConcern,
490
        ];
491
492
        if ($this->db === null) {
493
            $this->db = $this->connection->getClient()->selectDatabase($this->name, $options);
494
        } else {
495
            $this->db = $this->db->withOptions($options);
496
        }
497
    }
498
499
    private function checkDatabaseName($name)
500
    {

lib/Mongo/MongoCollection.php 1 location

@@ 838-850 (lines=13) @@
835
    /**
836
     * @return \MongoDB\Collection
837
     */
838
    private function createCollectionObject()
839
    {
840
        $options = [
841
            'readPreference' => $this->readPreference,
842
            'writeConcern' => $this->writeConcern,
843
        ];
844
845
        if ($this->collection === null) {
846
            $this->collection = $this->db->getDb()->selectCollection($this->name, $options);
847
        } else {
848
            $this->collection = $this->collection->withOptions($options);
849
        }
850
    }
851
852
    /**
853
     * Converts legacy write concern options to a WriteConcern object