LowerThanLogic::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 4
c 1
b 0
f 0
dl 0
loc 11
rs 10
cc 1
nc 1
nop 3
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 LowerThanLogic extends AbstractQuery
12
{
13
    use OperationTrait;
14
15
    /**
16
     * @var QueryInterface
17
     */
18
    private $query;
19
20
    /**
21
     * @var mixed
22
     */
23
    private $value;
24
25
    public function __construct(
26
        RethinkInterface $rethink,
27
        QueryInterface $query,
28
        $value
29
    ) {
30
        parent::__construct($rethink);
31
32
        $this->value = $value;
33
        $this->rethink = $rethink;
34
35
        $this->query = $query;
36
    }
37
38
    public function toArray(): array
39
    {
40
        return
41
            [
42
                TermType::LT,
43
                [
44
                    $this->query->toArray(),
45
                    $this->value,
46
                ],
47
            ];
48
    }
49
}
50