Passed
Push — master ( 112cee...b68050 )
by Michel
03:20
created

AbstractTransformationCompound   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 41
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 5
dl 0
loc 41
rs 10
c 0
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A limit() 0 3 1
A orderBy() 0 3 1
A getField() 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\Logic\GetFieldLogic;
7
use TBolier\RethinkQL\Query\Operation\AbstractOperation;
8
use TBolier\RethinkQL\Query\QueryInterface;
9
10
abstract class AbstractTransformationCompound extends AbstractOperation implements TransformationCompoundInterface
11
{
12
    /**
13
     * @param string $field
14
     * @return TransformationCompoundInterface
15
     */
16
    public function getField(string $field): TransformationCompoundInterface
17
    {
18
        return new GetFieldLogic($this->rethink, $field, $this);
19
    }
20
21
    /**
22
     * @inheritdoc
23
     */
24
    public function isEmpty(): QueryInterface
25
    {
26
        return new IsEmpty($this->rethink, $this);
27
    }
28
29
    /**
30
     * @inheritdoc
31
     */
32
    public function limit($value): TransformationCompoundInterface
33
    {
34
        return new Limit($this->rethink, $this, $value);
35
    }
36
37
    /**
38
     * @inheritdoc
39
     */
40
    public function skip($value): TransformationCompoundInterface
41
    {
42
        return new Skip($this->rethink, $this, $value);
43
    }
44
45
    /**
46
     * @inheritdoc
47
     */
48
    public function orderBy($key): TransformationCompoundInterface
49
    {
50
        return new OrderBy($this->rethink, $this, $key);
51
    }
52
}
53