Failed Conditions
Pull Request — master (#38)
by Timon
03:23
created

Ungroup   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
dl 0
loc 33
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 10 1
A toArray() 0 6 1
1
<?php
2
declare(strict_types=1);
3
4
namespace TBolier\RethinkQL\Query\Aggregation;
5
6
use TBolier\RethinkQL\Message\MessageInterface;
7
use TBolier\RethinkQL\Query\QueryInterface;
8
use TBolier\RethinkQL\Query\Transformation\AbstractTransformationCompound;
9
use TBolier\RethinkQL\RethinkInterface;
10
use TBolier\RethinkQL\Types\Term\TermType;
11
12
    class Ungroup extends AbstractTransformationCompound
13
{
14
    /**
15
     * @var QueryInterface
16
     */
17
      private $query;
18
19
    /**
20
     * @param RethinkInterface $rethink
21
     * @param MessageInterface $message
22
     * @param QueryInterface $query
23
     */
24
    public function __construct(
25
        RethinkInterface $rethink,
26
        MessageInterface $message,
27
        QueryInterface $query
28
    ) {
29
        parent::__construct($rethink, $message);
30
31
        $this->query = $query;
32
        $this->rethink = $rethink;
33
        $this->message = $message;
34
    }
35
36
    /**
37
     * @inheritdoc
38
     */
39
    public function toArray(): array
40
    {
41
        return [
42
            TermType::UNGROUP,
43
            [
44
                $this->query->toArray(),
45
            ],
46
        ];
47
    }
48
}
0 ignored issues
show
Coding Style introduced by
Closing brace indented incorrectly; expected 4 spaces, found 0
Loading history...
49