Passed
Push — master ( 8a5d70...d3fd03 )
by Timon
02:29
created

Keys   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 10
dl 0
loc 26
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\Manipulation;
5
6
use TBolier\RethinkQL\Query\AbstractQuery;
7
use TBolier\RethinkQL\Query\Aggregation\AggregationTrait;
8
use TBolier\RethinkQL\Query\Operation\OperationTrait;
9
use TBolier\RethinkQL\Query\QueryInterface;
10
use TBolier\RethinkQL\Query\Transformation\TransformationTrait;
11
use TBolier\RethinkQL\RethinkInterface;
12
use TBolier\RethinkQL\Types\Term\TermType;
13
14
class Keys extends AbstractQuery
15
{
16
    use AggregationTrait;
17
    use TransformationTrait;
18
19
    /**
20
     * @var QueryInterface
21
     */
22
    private $query;
23
24
    public function __construct(
25
        RethinkInterface $rethink,
26
        QueryInterface $query
27
    ) {
28
        parent::__construct($rethink);
29
30
        $this->query   = $query;
31
        $this->rethink = $rethink;
32
    }
33
34
    public function toArray(): array
35
    {
36
        return [
37
            TermType::KEYS,
38
            [
39
                $this->query->toArray()
40
            ]
41
        ];
42
    }
43
}
44