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

AbstractTransformationCompound   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 4
dl 0
loc 32
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A limit() 0 3 1
A orderBy() 0 3 1
A isEmpty() 0 3 1
A skip() 0 3 1
1
<?php
2
declare(strict_types = 1);
3
4
namespace TBolier\RethinkQL\Query\Transformation;
5
6
use TBolier\RethinkQL\Query\Operation\AbstractOperation;
7
use TBolier\RethinkQL\Query\QueryInterface;
8
9
abstract class AbstractTransformationCompound extends AbstractOperation implements TransformationCompoundInterface
10
{
11
    /**
12
     * @inheritdoc
13
     */
14
    public function isEmpty(): QueryInterface
15
    {
16
        return new IsEmpty($this->rethink, $this->message, $this);
17
    }
18
19
    /**
20
     * @inheritdoc
21
     */
22
    public function limit($value): TransformationCompoundInterface
23
    {
24
        return new Limit($this->rethink, $this->message, $this, $value);
25
    }
26
27
    /**
28
     * @inheritdoc
29
     */
30
    public function skip($value): TransformationCompoundInterface
31
    {
32
        return new Skip($this->rethink, $this->message, $this, $value);
33
    }
34
35
    /**
36
     * @inheritdoc
37
     */
38
    public function orderBy($key): TransformationCompoundInterface
39
    {
40
        return new OrderBy($this->rethink, $this->message, $this, $key);
41
    }
42
}
43