Failed Conditions
Pull Request — master (#34)
by Marc
03:16
created

AbstractOperation   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 48
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 6
dl 0
loc 48
rs 10
c 0
b 0
f 0
ccs 10
cts 10
cp 1

6 Methods

Rating   Name   Duplication   Size   Complexity  
A count() 0 3 1
A delete() 0 3 1
A filter() 0 3 1
A getAll() 0 3 1
A update() 0 3 1
A insert() 0 3 1
1
<?php
2
declare(strict_types = 1);
3
4
namespace TBolier\RethinkQL\Query\Operation;
5
6
use TBolier\RethinkQL\Query\Aggregation\AbstractAggregation;
7
use TBolier\RethinkQL\Query\QueryInterface;
8
9
abstract class AbstractOperation extends AbstractAggregation 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 $predicate): OperationInterface
31
    {
32 5
        return new Filter($this->rethink, $this->message, $this, $predicate);
33
    }
34
35
    /**
36
     * @inheritdoc
37
     */
38 1
    public function getAll(...$keys): OperationInterface
39
    {
40 1
        return new GetAll($this->rethink, $this->message, $this, $keys);
41
    }
42
43
    /**
44
     * @inheritdoc
45
     */
46 9
    public function update(array $elements): QueryInterface
47
    {
48 9
        return new Update($this->rethink, $this->message, $this, $elements);
49
    }
50
51
    /**
52
     * @inheritdoc
53
     */
54
    public function insert(array $document): QueryInterface
55
    {
56
        return new Insert($this->rethink, $this->message, $this, $document);
57
    }
58
}
59