Passed
Pull Request — master (#18)
by Marc
03:37
created

AbstractOperation   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 5

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 5
dl 0
loc 34
ccs 8
cts 8
cp 1
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A count() 0 4 1
A delete() 0 4 1
A update() 0 4 1
A insert() 0 4 1
1
<?php
2
declare(strict_types=1);
3
4
namespace TBolier\RethinkQL\Query\Operation;
5
6
use TBolier\RethinkQL\Query\AbstractQuery;
7
8
abstract class AbstractOperation extends AbstractQuery
9
{
10
    /**
11
     * @inheritdoc
12
     */
13 5
    public function count(): AbstractOperation
14
    {
15 5
        return new Count($this->rethink, $this->message, $this);
16
    }
17
18
    /**
19
     * @inheritdoc
20
     */
21 2
    public function delete(): AbstractOperation
22
    {
23 2
        return new Delete($this->rethink, $this->message, $this);
24
    }
25
26
    /**
27
     * @inheritdoc
28
     */
29 1
    public function update(array $document): AbstractOperation
30
    {
31 1
        return new Update($this->rethink, $this->message, $this, $document);
32
    }
33
34
    /**
35
     * @inheritdoc
36
     */
37 8
    public function insert(array $document): AbstractOperation
38
    {
39 8
        return new Insert($this->rethink, $this->message, $this, $document);
40
    }
41
}
42