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

Options::jsonSerialize()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 2
cts 2
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 0
crap 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