Test Failed
Pull Request — master (#66)
by Timon
02:12
created

AggregationTrait   A

Complexity

Total Complexity 7

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 7
eloc 8
dl 0
loc 35
rs 10
c 0
b 0
f 0

7 Methods

Rating   Name   Duplication   Size   Complexity  
A group() 0 3 1
A count() 0 3 1
A ungroup() 0 3 1
A max() 0 3 1
A sum() 0 3 1
A min() 0 3 1
A avg() 0 3 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
    public function count(): QueryInterface
11
    {
12
        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

12
        return new Count($this->rethink, /** @scrutinizer ignore-type */ $this);
Loading history...
13
    }
14
15
    public function group(string $key)
16
    {
17
        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

17
        return new Group($this->rethink, /** @scrutinizer ignore-type */ $this, $key);
Loading history...
18
    }
19
20
    public function ungroup()
21
    {
22
        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

22
        return new Ungroup($this->rethink, /** @scrutinizer ignore-type */ $this);
Loading history...
23
    }
24
25
    public function sum(string $key): QueryInterface
26
    {
27
        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

27
        return new Sum($this->rethink, /** @scrutinizer ignore-type */ $this, $key);
Loading history...
28
    }
29
30
    public function avg(string $key): QueryInterface
31
    {
32
        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

32
        return new Avg($this->rethink, /** @scrutinizer ignore-type */ $this, $key);
Loading history...
33
    }
34
35
    public function min(string $key)
36
    {
37
        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

37
        return new Min($this->rethink, /** @scrutinizer ignore-type */ $this, $key);
Loading history...
38
    }
39
40
    public function max(string $key)
41
    {
42
        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

42
        return new Max($this->rethink, /** @scrutinizer ignore-type */ $this, $key);
Loading history...
43
    }
44
}
45