Test Failed
Pull Request — master (#69)
by Jérémy
03:26
created

Keys   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 11
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 5 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 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