LowerThanLogic   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 12
c 1
b 0
f 0
dl 0
loc 35
rs 10

2 Methods

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