Completed
Pull Request — master (#5)
by Alessandro
03:10
created

Client::selectDatabase()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 5

Duplication

Lines 9
Ratio 100 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 9
loc 9
ccs 4
cts 4
cp 1
rs 9.6666
cc 1
eloc 5
nc 1
nop 2
crap 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Facile\MongoDbBundle\Capsule;
6
7
use MongoDB\Client as MongoClient;
8
9
/**
10
 * Class Client.
11
 */
12
final class Client extends MongoClient
13
{
14
    /**
15
     * {@inheritdoc}
16
     */
17 2 View Code Duplication
    public function selectDatabase($databaseName, array $options = [])
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
18
    {
19 2
        $debug = $this->__debugInfo();
20
        $options += [
21 2
            'typeMap' => $debug['typeMap'],
22
        ];
23
24 2
        return new Database($debug['manager'], $databaseName, $options);
25
    }
26
27
    /**
28
     * {@inheritdoc}
29
     */
30 View Code Duplication
    public function selectCollection($databaseName, $collectionName, array $options = [])
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
31
    {
32
        $debug = $this->__debugInfo();
33
        $options += [
34
            'typeMap' => $debug['typeMap'],
35
        ];
36
37
        return new Collection($debug['manager'], $databaseName, $collectionName, $options);
38
    }
39
}
40