Passed
Pull Request — master (#18)
by Timon
04:12
created

AbstractOperation   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 44
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 44
ccs 11
cts 11
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 6 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
        $filter = new Filter($this->rethink, $this->message, $this, $documents);
33
34 5
        return $filter;
35
    }
36
37
    /**
38
     * @inheritdoc
39
     */
40 1
    public function update(array $document): QueryInterface
41
    {
42 1
        return new Update($this->rethink, $this->message, $this, $document);
43
    }
44
45
    /**
46
     * @inheritdoc
47
     */
48 8
    public function insert(array $document): QueryInterface
49
    {
50 8
        return new Insert($this->rethink, $this->message, $this, $document);
51
    }
52
}
53