Delete   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 8
c 1
b 0
f 0
dl 0
loc 21
rs 10
ccs 6
cts 6
cp 1

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A toArray() 0 6 1
1
<?php
2
declare(strict_types = 1);
3
4
namespace TBolier\RethinkQL\Query\Operation;
5
6
use TBolier\RethinkQL\Query\AbstractQuery;
7
use TBolier\RethinkQL\Query\QueryInterface;
8
use TBolier\RethinkQL\RethinkInterface;
9
use TBolier\RethinkQL\Types\Term\TermType;
10
11
class Delete extends AbstractQuery
12
{
13
    /**
14
     * @var QueryInterface
15
     */
16
    private $query;
17
18
    public function __construct(RethinkInterface $rethink, QueryInterface $query)
19
    {
20
        parent::__construct($rethink);
21
22
        $this->query = $query;
23
        $this->rethink = $rethink;
24 2
    }
25
26 2
    public function toArray(): array
27
    {
28 2
        return [
29 2
            TermType::DELETE,
30 2
            [
31 2
                $this->query->toArray(),
32
            ],
33
        ];
34
    }
35
}
36