Code Duplication    Length = 13-13 lines in 2 locations

lib/Mongo/MongoCollection.php 1 location

@@ 935-947 (lines=13) @@
932
    /**
933
     * @return \MongoDB\Collection
934
     */
935
    private function createCollectionObject()
936
    {
937
        $options = [
938
            'readPreference' => $this->readPreference,
939
            'writeConcern' => $this->writeConcern,
940
        ];
941
942
        if ($this->collection === null) {
943
            $this->collection = $this->db->getDb()->selectCollection($this->name, $options);
944
        } else {
945
            $this->collection = $this->collection->withOptions($options);
946
        }
947
    }
948
949
    /**
950
     * Converts legacy write concern options to a WriteConcern object

lib/Mongo/MongoDB.php 1 location

@@ 516-528 (lines=13) @@
513
    /**
514
     * @return \MongoDB\Database
515
     */
516
    private function createDatabaseObject()
517
    {
518
        $options = [
519
            'readPreference' => $this->readPreference,
520
            'writeConcern' => $this->writeConcern,
521
        ];
522
523
        if ($this->db === null) {
524
            $this->db = $this->connection->getClient()->selectDatabase($this->name, $options);
525
        } else {
526
            $this->db = $this->db->withOptions($options);
527
        }
528
    }
529
530
    private function checkDatabaseName($name)
531
    {