Code Duplication    Length = 13-13 lines in 2 locations

lib/Mongo/MongoCollection.php 1 location

@@ 543-555 (lines=13) @@
540
    /**
541
     * @return \MongoDB\Collection
542
     */
543
    private function createCollectionObject()
544
    {
545
        $options = [
546
            'readPreference' => $this->readPreference,
547
            'writeConcern' => $this->writeConcern,
548
        ];
549
550
        if ($this->collection === null) {
551
            $this->collection = $this->db->getDb()->selectCollection($this->name, $options);
552
        } else {
553
            $this->collection = $this->collection->withOptions($options);
554
        }
555
    }
556
}
557
558

lib/Mongo/MongoDB.php 1 location

@@ 508-520 (lines=13) @@
505
    /**
506
     * @return \MongoDB\Database
507
     */
508
    private function createDatabaseObject()
509
    {
510
        $options = [
511
            'readPreference' => $this->readPreference,
512
            'writeConcern' => $this->writeConcern,
513
        ];
514
515
        if ($this->db === null) {
516
            $this->db = $this->connection->getClient()->selectDatabase($this->name, $options);
517
        } else {
518
            $this->db = $this->db->withOptions($options);
519
        }
520
    }
521
}
522