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

AbstractOperation   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 42
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 6

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 5
lcom 1
cbo 6
dl 0
loc 42
ccs 10
cts 10
cp 1
rs 10
c 0
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A count() 0 4 1
A delete() 0 4 1
A filter() 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
use TBolier\RethinkQL\Query\QueryInterface;
8
9
abstract class AbstractOperation extends AbstractQuery implements OperationInterface
10
{
11
    /**
12
     * @inheritdoc
13
     */
14 6
    public function count(): QueryInterface
15
    {
16 6
        return new Count($this->rethink, $this->message, $this);
17
    }
18
19
    /**
20
     * @inheritdoc
21
     */
22 2
    public function delete(): QueryInterface
23
    {
24 2
        return new Delete($this->rethink, $this->message, $this);
25
    }
26
27
    /**
28
     * @inheritdoc
29
     */
30 5
    public function filter(array $documents): OperationInterface
31
    {
32 5
        return new Filter($this->rethink, $this->message, $this, $documents);
33
    }
34
35
    /**
36
     * @inheritdoc
37
     */
38 1
    public function update(array $document): QueryInterface
39
    {
40 1
        return new Update($this->rethink, $this->message, $this, $document);
41
    }
42
43
    /**
44
     * @inheritdoc
45
     */
46 8
    public function insert(array $document): QueryInterface
47
    {
48 8
        return new Insert($this->rethink, $this->message, $this, $document);
49
    }
50
}
51