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

NotLogic   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Importance

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

2 Methods

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