Passed
Push — master ( e0d17a...139da0 )
by Michel
03:37
created

GetFieldLogic::toArray()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

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