NotLogic   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Importance

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

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
4
namespace TBolier\RethinkQL\Query\Logic;
5
6
use TBolier\RethinkQL\Query\AbstractQuery;
7
use TBolier\RethinkQL\Query\Operation\OperationTrait;
8
use TBolier\RethinkQL\Query\QueryInterface;
9
use TBolier\RethinkQL\RethinkInterface;
10
use TBolier\RethinkQL\Types\Term\TermType;
11
12
class NotLogic extends AbstractQuery
13
{
14
    use OperationTrait;
15
16
    /**
17
     * @var QueryInterface
18
     */
19
    private $query;
20
    
21
    public function __construct(
22
        RethinkInterface $rethink,
23
        QueryInterface $query
24
    ) {
25
        parent::__construct($rethink);
26
27
        $this->rethink = $rethink;
28
        $this->query = $query;
29
    }
30
31
    public function toArray(): array
32
    {
33
        return
34
            [
35
                TermType::NOT,
36
                [
37
                    $this->query->toArray(),
38
                ],
39
            ];
40
    }
41
}
42