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

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