Test Failed
Push — master ( 3b363c...e4d46c )
by Timon
05:21
created

GreaterThanOrEqualToLogic::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

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