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

AbstractAggregation::group()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

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
1
<?php
2
declare(strict_types = 1);
3
4
namespace TBolier\RethinkQL\Query\Aggregation;
5
6
use TBolier\RethinkQL\Query\AbstractQuery;
7
use TBolier\RethinkQL\Query\QueryInterface;
8
use TBolier\RethinkQL\Query\Transformation\TransformationCompoundInterface;
9
10
abstract class AbstractAggregation extends AbstractQuery implements AggregationInterface
11
{
12
    /**
13
     * @inheritdoc
14
     */
15
    public function count(): QueryInterface
16
    {
17
        return new Count($this->rethink, $this);
18
    }
19
20
    /**
21
     * @inheritdoc
22
     */
23
    public function group(string $key): TransformationCompoundInterface
24
    {
25
        return new Group($this->rethink, $this, $key);
26
    }
27
28
    /**
29
     * @inheritdoc
30
     */
31
    public function ungroup(): TransformationCompoundInterface
32
    {
33
        return new Ungroup($this->rethink, $this);
34
    }
35
36
    /**
37
     * @inheritdoc
38
     */
39
    public function sum(string $key): QueryInterface
40
    {
41
        return new Sum($this->rethink, $this, $key);
42
    }
43
44
    /**
45
     * @inheritdoc
46
     */
47
    public function avg(string $key): QueryInterface
48
    {
49
        return new Avg($this->rethink, $this, $key);
50
    }
51
52
    /**
53
     * @inheritdoc
54
     */
55
    public function min(string $key): AggregationInterface
56
    {
57
        return new Min($this->rethink, $this, $key);
58
    }
59
60
    /**
61
     * @inheritdoc
62
     */
63
    public function max(string $key): TransformationCompoundInterface
64
    {
65
        return new Max($this->rethink, $this, $key);
66
    }
67
}
68