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

GreaterThanOrEqualToLogic   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 41
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
dl 0
loc 41
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 11 1
A toArray() 0 8 1
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