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

AbstractOperation::insert()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 1
CRAP Score 1

Importance

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