Passed
Pull Request — master (#66)
by Timon
02:32
created

AggregationTrait::group()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
c 0
b 0
f 0
rs 10
cc 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\QueryInterface;
7
8
trait AggregationTrait
9
{
10
    /**
11
     * @inheritdoc
12
     */
13
    public function count(): QueryInterface
14
    {
15
        return new Count($this->rethink, $this);
0 ignored issues
show
Bug introduced by
$this of type TBolier\RethinkQL\Query\...gation\AggregationTrait is incompatible with the type TBolier\RethinkQL\Query\QueryInterface expected by parameter $query of TBolier\RethinkQL\Query\...on\Count::__construct(). ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

15
        return new Count($this->rethink, /** @scrutinizer ignore-type */ $this);
Loading history...
16
    }
17
18
    /**
19
     * @inheritdoc
20
     */
21
    public function group(string $key)
22
    {
23
        return new Group($this->rethink, $this, $key);
0 ignored issues
show
Bug introduced by
$this of type TBolier\RethinkQL\Query\...gation\AggregationTrait is incompatible with the type TBolier\RethinkQL\Query\QueryInterface expected by parameter $query of TBolier\RethinkQL\Query\...on\Group::__construct(). ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

23
        return new Group($this->rethink, /** @scrutinizer ignore-type */ $this, $key);
Loading history...
24
    }
25
26
    /**
27
     * @inheritdoc
28
     */
29
    public function ungroup()
30
    {
31
        return new Ungroup($this->rethink, $this);
0 ignored issues
show
Bug introduced by
$this of type TBolier\RethinkQL\Query\...gation\AggregationTrait is incompatible with the type TBolier\RethinkQL\Query\QueryInterface expected by parameter $query of TBolier\RethinkQL\Query\...\Ungroup::__construct(). ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

31
        return new Ungroup($this->rethink, /** @scrutinizer ignore-type */ $this);
Loading history...
32
    }
33
34
    /**
35
     * @inheritdoc
36
     */
37
    public function sum(string $key): QueryInterface
38
    {
39
        return new Sum($this->rethink, $this, $key);
0 ignored issues
show
Bug introduced by
$this of type TBolier\RethinkQL\Query\...gation\AggregationTrait is incompatible with the type TBolier\RethinkQL\Query\QueryInterface expected by parameter $query of TBolier\RethinkQL\Query\...tion\Sum::__construct(). ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

39
        return new Sum($this->rethink, /** @scrutinizer ignore-type */ $this, $key);
Loading history...
40
    }
41
42
    /**
43
     * @inheritdoc
44
     */
45
    public function avg(string $key): QueryInterface
46
    {
47
        return new Avg($this->rethink, $this, $key);
0 ignored issues
show
Bug introduced by
$this of type TBolier\RethinkQL\Query\...gation\AggregationTrait is incompatible with the type TBolier\RethinkQL\Query\QueryInterface expected by parameter $query of TBolier\RethinkQL\Query\...tion\Avg::__construct(). ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

47
        return new Avg($this->rethink, /** @scrutinizer ignore-type */ $this, $key);
Loading history...
48
    }
49
50
    /**
51
     * @inheritdoc
52
     */
53
    public function min(string $key)
54
    {
55
        return new Min($this->rethink, $this, $key);
0 ignored issues
show
Bug introduced by
$this of type TBolier\RethinkQL\Query\...gation\AggregationTrait is incompatible with the type TBolier\RethinkQL\Query\QueryInterface expected by parameter $query of TBolier\RethinkQL\Query\...tion\Min::__construct(). ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

55
        return new Min($this->rethink, /** @scrutinizer ignore-type */ $this, $key);
Loading history...
56
    }
57
58
    /**
59
     * @inheritdoc
60
     */
61
    public function max(string $key)
62
    {
63
        return new Max($this->rethink, $this, $key);
0 ignored issues
show
Bug introduced by
$this of type TBolier\RethinkQL\Query\...gation\AggregationTrait is incompatible with the type TBolier\RethinkQL\Query\QueryInterface expected by parameter $query of TBolier\RethinkQL\Query\...tion\Max::__construct(). ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

63
        return new Max($this->rethink, /** @scrutinizer ignore-type */ $this, $key);
Loading history...
64
    }
65
}
66