Test Failed
Pull Request — master (#69)
by Timon
02:54
created

Keys::toArray()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 3
dl 0
loc 5
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\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 OperationTrait;
18
    use TransformationTrait;
19
20
    /**
21
     * @var QueryInterface
22
     */
23
    private $query;
24
25
    public function __construct(
26
        RethinkInterface $rethink,
27
        QueryInterface $query
28
    ) {
29
        parent::__construct($rethink);
30
31
        $this->query   = $query;
32
        $this->rethink = $rethink;
33
    }
34
35
    public function toArray(): array
36
    {
37
        return [
38
            TermType::KEYS,
39
            $this->query->toArray(),
40
        ];
41
    }
42
}
43