Passed
Push — master ( ebcfce...77f680 )
by Timon
03:24
created

NotLogic::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 8
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 2
1
<?php
2
declare(strict_types=1);
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 NotLogic extends AbstractOperation
11
{
12
    /**
13
     * @var QueryInterface
14
     */
15
    private $query;
16
17
    /**
18
     * @param RethinkInterface $rethink
19
     * @param QueryInterface $query
20
     * @param mixed $value
21
     */
22
    public function __construct(
23
        RethinkInterface $rethink,
24
        QueryInterface $query
25
    ) {
26
        parent::__construct($rethink);
27
28
        $this->rethink = $rethink;
29
        $this->query = $query;
30
    }
31
32
    /**
33
     * @inheritdoc
34
     */
35
    public function toArray(): array
36
    {
37
        return
38
            [
39
                TermType::NOT,
40
                [
41
                    $this->query->toArray(),
42
                ],
43
            ];
44
    }
45
}
46