Passed
Pull Request — master (#18)
by Timon
05:57 queued 02:54
created

DbDrop   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 1
dl 0
loc 37
ccs 9
cts 9
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 8 1
A toArray() 0 12 1
1
<?php
2
declare(strict_types=1);
3
4
namespace TBolier\RethinkQL\Query\Operation;
5
6
use TBolier\RethinkQL\Message\MessageInterface;
7
use TBolier\RethinkQL\Query\AbstractQuery;
8
use TBolier\RethinkQL\RethinkInterface;
9
use TBolier\RethinkQL\Types\Term\TermType;
10
11
class DbDrop extends AbstractQuery
12
{
13
    /**
14
     * @var string
15
     */
16
    private $name;
17
18
    /**
19
     * @param RethinkInterface $rethink
20
     * @param MessageInterface $message
21
     * @param string $name
22
     */
23 13
    public function __construct(RethinkInterface $rethink, MessageInterface $message, string $name)
24
    {
25 13
        parent::__construct($rethink, $message);
26
27 13
        $this->rethink = $rethink;
28 13
        $this->message = $message;
29 13
        $this->name = $name;
30 13
    }
31
32
    /**
33
     * @inheritdoc
34
     */
35 13
    public function toArray(): array
36
    {
37
        return [
38 13
            TermType::DB_DROP,
39
            [
40
                [
41
                    TermType::DATUM,
42 13
                    $this->name,
43
                ],
44
            ],
45
        ];
46
    }
47
}
48