TableDrop   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A toArray() 0 8 1
A __construct() 0 7 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\RethinkInterface;
8
use TBolier\RethinkQL\Types\Term\TermType;
9
10
class TableDrop extends AbstractQuery
11
{
12
    /**
13
     * @var string
14
     */
15
    private $name;
16
17
    public function __construct(RethinkInterface $rethink, string $name)
18
    {
19
        parent::__construct($rethink);
20
21
        $this->rethink = $rethink;
22
        
23 12
        $this->name = $name;
24
    }
25 12
26
    public function toArray(): array
27 12
    {
28 12
        return [
29 12
            TermType::TABLE_DROP,
30 12
            [
31
                [
32
                    TermType::DATUM,
33
                    $this->name,
34
                ],
35 12
            ],
36
        ];
37
    }
38
}
39