Passed
Pull Request — master (#34)
by Marc
05:44
created

AbstractOperation   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

5 Methods

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