Passed
Pull Request — master (#74)
by Timon
02:43
created

Changes   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 8
dl 0
loc 25
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 8 1
A toArray() 0 6 1
1
<?php
2
declare(strict_types = 1);
3
4
namespace TBolier\RethinkQL\Query\Operation;
5
6
use TBolier\RethinkQL\Query\AbstractQuery;
7
use TBolier\RethinkQL\Query\QueryInterface;
8
use TBolier\RethinkQL\RethinkInterface;
9
use TBolier\RethinkQL\Types\Term\TermType;
10
11
class Changes extends AbstractQuery
12
{
13
    /**
14
     * @var QueryInterface
15
     */
16
    private $query;
17
18
    public function __construct(
19
        RethinkInterface $rethink,
20
        QueryInterface $query
21
    ) {
22
        parent::__construct($rethink);
23
24
        $this->query = $query;
25
        $this->rethink = $rethink;
26
    }
27
28
    // [1,[152,[[15,[[14,["booking"]],"etabs"]]]],{"binary_format":"raw","time_format":"raw","profile":false}]
29
    // [1,[[1,[152,[[15,["tabletest"]]]]]],{"db":[14,["test"]]}]
30
    public function toArray(): array
31
    {
32
        return [
33
            TermType::CHANGES,
34
            [
35
                $this->query->toArray(),
36
            ],
37
        ];
38
    }
39
}
40