NotLogic::toArray()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 3
c 1
b 0
f 0
dl 0
loc 7
rs 10
cc 1
nc 1
nop 0
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