Code Duplication    Length = 13-13 lines in 2 locations

lib/Mongo/MongoCollection.php 1 location

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

lib/Mongo/MongoDB.php 1 location

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