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

TransformationTrait   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 4
eloc 5
dl 0
loc 20
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A isEmpty() 0 3 1
A orderBy() 0 3 1
A skip() 0 3 1
A limit() 0 3 1
1
<?php
2
declare(strict_types = 1);
3
4
namespace TBolier\RethinkQL\Query\Transformation;
5
6
use TBolier\RethinkQL\Query\QueryInterface;
7
8
trait TransformationTrait
9
{
10
    public function isEmpty(): QueryInterface
11
    {
12
        return new IsEmpty($this->rethink, $this);
0 ignored issues
show
Bug introduced by
$this of type TBolier\RethinkQL\Query\...ion\TransformationTrait is incompatible with the type TBolier\RethinkQL\Query\QueryInterface expected by parameter $query of TBolier\RethinkQL\Query\...\IsEmpty::__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 IsEmpty($this->rethink, /** @scrutinizer ignore-type */ $this);
Loading history...
13
    }
14
15
    public function limit($value): Limit
16
    {
17
        return new Limit($this->rethink, $this, $value);
0 ignored issues
show
Bug introduced by
$this of type TBolier\RethinkQL\Query\...ion\TransformationTrait is incompatible with the type TBolier\RethinkQL\Query\QueryInterface expected by parameter $query of TBolier\RethinkQL\Query\...on\Limit::__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 Limit($this->rethink, /** @scrutinizer ignore-type */ $this, $value);
Loading history...
18
    }
19
20
    public function skip($value): Skip
21
    {
22
        return new Skip($this->rethink, $this, $value);
0 ignored issues
show
Bug introduced by
$this of type TBolier\RethinkQL\Query\...ion\TransformationTrait is incompatible with the type TBolier\RethinkQL\Query\QueryInterface expected by parameter $query of TBolier\RethinkQL\Query\...ion\Skip::__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 Skip($this->rethink, /** @scrutinizer ignore-type */ $this, $value);
Loading history...
23
    }
24
25
    public function orderBy($key): OrderBy
26
    {
27
        return new OrderBy($this->rethink, $this, $key);
0 ignored issues
show
Bug introduced by
$this of type TBolier\RethinkQL\Query\...ion\TransformationTrait is incompatible with the type TBolier\RethinkQL\Query\QueryInterface expected by parameter $query of TBolier\RethinkQL\Query\...\OrderBy::__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 OrderBy($this->rethink, /** @scrutinizer ignore-type */ $this, $key);
Loading history...
28
    }
29
}
30