Code Duplication    Length = 13-13 lines in 2 locations

lib/Mongo/MongoDB.php 1 location

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

lib/Mongo/MongoCollection.php 1 location

@@ 788-800 (lines=13) @@
785
    /**
786
     * @return \MongoDB\Collection
787
     */
788
    private function createCollectionObject()
789
    {
790
        $options = [
791
            'readPreference' => $this->readPreference,
792
            'writeConcern' => $this->writeConcern,
793
        ];
794
795
        if ($this->collection === null) {
796
            $this->collection = $this->db->getDb()->selectCollection($this->name, $options);
797
        } else {
798
            $this->collection = $this->collection->withOptions($options);
799
        }
800
    }
801
802
    /**
803
     * Converts legacy write concern options to a WriteConcern object