GroupBy::getField()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 1
1
<?php
2
/**
3
 * This file is part of Hydrogen package.
4
 *
5
 * For the full copyright and license information, please view the LICENSE
6
 * file that was distributed with this source code.
7
 */
8
declare(strict_types=1);
9
10
namespace RDS\Hydrogen\Criteria;
11
12
use RDS\Hydrogen\Criteria\Common\Field;
13
use RDS\Hydrogen\Query;
14
15
/**
16
 * Class GroupBy
17
 */
18
class GroupBy extends Criterion
19
{
20
    /**
21
     * @var Field
22
     */
23
    private $field;
24
25
    /**
26
     * GroupBy constructor.
27
     * @param Query $query
28
     * @param string $field
29
     */
30 2
    public function __construct(Query $query, string $field)
31
    {
32 2
        parent::__construct($query);
33
34 2
        $this->field = new Field($field);
35 2
    }
36
37
    /**
38
     * @return Field
39
     */
40 2
    public function getField(): Field
41
    {
42 2
        return $this->field;
43
    }
44
}
45