Code Duplication    Length = 13-13 lines in 2 locations

lib/Mongo/MongoCollection.php 1 location

@@ 675-687 (lines=13) @@
672
    /**
673
     * @return \MongoDB\Collection
674
     */
675
    private function createCollectionObject()
676
    {
677
        $options = [
678
            'readPreference' => $this->readPreference,
679
            'writeConcern' => $this->writeConcern,
680
        ];
681
682
        if ($this->collection === null) {
683
            $this->collection = $this->db->getDb()->selectCollection($this->name, $options);
684
        } else {
685
            $this->collection = $this->collection->withOptions($options);
686
        }
687
    }
688
}
689
690

lib/Mongo/MongoDB.php 1 location

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