Passed
Push — master ( ae31ea...e44bbb )
by Michel
02:38
created

Options   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 0
dl 0
loc 31
ccs 7
cts 7
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A setDb() 0 9 1
A jsonSerialize() 0 6 1
1
<?php
2
3
namespace TBolier\RethinkQL\Query;
4
5
use TBolier\RethinkQL\Types\Term\TermType;
6
7
class Options implements OptionsInterface
8
{
9
    /**
10
     * @var array
11
     */
12
    private $db;
13
14
    /**
15
     * @param string $name
16
     * @return OptionsInterface
17
     */
18 13
    public function setDb(string $name): OptionsInterface
19
    {
20 13
        $this->db = [
21 13
            TermType::DB,
22 13
            [$name],
23
        ];
24
25 13
        return $this;
26
    }
27
28
    /**
29
     * @inheritdoc
30
     */
31 13
    public function jsonSerialize()
32
    {
33
        return [
34 13
            'db' => $this->db
35
        ];
36
    }
37
}
38