FuncLogic::toArray()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 13
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
c 1
b 0
f 0
dl 0
loc 13
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
namespace TBolier\RethinkQL\Query\Logic;
4
5
use TBolier\RethinkQL\Query\AbstractQuery;
6
use TBolier\RethinkQL\Query\Operation\OperationTrait;
7
use TBolier\RethinkQL\Query\QueryInterface;
8
use TBolier\RethinkQL\RethinkInterface;
9
use TBolier\RethinkQL\Types\Term\TermType;
10
11
class FuncLogic extends AbstractQuery
12
{
13
    use OperationTrait;
14
15
    /**
16
     * @var QueryInterface
17
     */
18
    private $query;
19
20
    public function __construct(
21
        RethinkInterface $rethink,
22
        QueryInterface $query
23
    ) {
24
        parent::__construct($rethink);
25
26
        $this->rethink = $rethink;
27
28
        $this->query = $query;
29
    }
30
31
    public function toArray(): array
32
    {
33
        return
34
            [
35
                TermType::FUNC,
36
                [
37
                    [
38
                        TermType::MAKE_ARRAY,
39
                        [
40
                            TermType::DATUM,
41
                        ],
42
                    ],
43
                    $this->query->toArray(),
44
                ],
45
            ];
46
    }
47
}
48