Completed
Push — master ( 39e455...df545d )
by Alessandro
03:04
created

Database   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 1
c 1
b 0
f 1
lcom 0
cbo 2
dl 0
loc 18
ccs 0
cts 11
cp 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A selectCollection() 0 12 1
1
<?php
2
3
declare(strict_types = 1);
4
5
namespace Facile\MongoDbBundle\Capsule;
6
7
use MongoDB\Database as MongoDatabase;
8
9
/**
10
 * Class Database.
11
 */
12
class Database extends MongoDatabase
13
{
14
    /**
15
     * @inheritdoc
16
     */
17
    public function selectCollection(string $collectionName, array $options = [])
18
    {
19
        $debug = $this->__debugInfo();
20
        $options += [
21
            'readConcern' => $debug['readConcern'],
22
            'readPreference' => $debug['readPreference'],
23
            'typeMap' => $debug['typeMap'],
24
            'writeConcern' => $debug['writeConcern'],
25
        ];
26
27
        return new Collection($debug['manager'], $debug['databaseName'], $collectionName, $options);
28
    }
29
}
30