Passed
Push — master ( a4b5ac...9bd082 )
by Timon
02:35
created

Sync::toArray()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 3
dl 0
loc 6
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
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 Sync 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
    public function toArray(): array
29
    {
30
        return [
31
            TermType::SYNC,
32
            [
33
                $this->query->toArray(),
34
            ],
35
        ];
36
    }
37
}
38