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

AbstractOperation::update()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
crap 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