GroupByTrait   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 54
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
dl 0
loc 54
c 0
b 0
f 0
wmc 4
lcom 1
cbo 1
ccs 0
cts 11
cp 0
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A addGroupBy() 0 8 1
A getGroupByClauses() 0 4 1
A isGroupByWithRollUp() 0 4 1
A setGroupByWithRollUp() 0 6 1
1
<?php
2
3
/**
4
 * This file is part of UnderQuery package.
5
 *
6
 * Copyright (c) 2016 Beniamin Jonatan Šimko
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Phuria\UnderQuery\QueryBuilder\Clause;
13
14
use Phuria\UnderQuery\Utils\RecursiveArgs;
15
16
/**
17
 * @author Beniamin Jonatan Šimko <[email protected]>
18
 */
19
trait GroupByTrait
20
{
21
    /**
22
     * @var bool
23
     */
24
    private $groupByWithRollUp = false;
25
26
    /**
27
     * @var array
28
     */
29
    private $groupByClauses = [];
30
31
    /**
32
     * @param mixed $_
33
     *
34
     * @return $this
35
     */
36
    public function addGroupBy($_)
0 ignored issues
show
Unused Code introduced by
The parameter $_ is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
37
    {
38
        RecursiveArgs::each(func_get_args(), function ($arg) {
39
            $this->groupByClauses[] = $arg;
40
        });
41
42
        return $this;
43
    }
44
45
    /**
46
     * @return array
47
     */
48
    public function getGroupByClauses()
49
    {
50
        return $this->groupByClauses;
51
    }
52
53
    /**
54
     * @return boolean
55
     */
56
    public function isGroupByWithRollUp()
57
    {
58
        return $this->groupByWithRollUp;
59
    }
60
61
    /**
62
     * @param boolean $groupByWithRollUp
63
     *
64
     * @return $this
65
     */
66
    public function setGroupByWithRollUp($groupByWithRollUp)
67
    {
68
        $this->groupByWithRollUp = $groupByWithRollUp;
69
70
        return $this;
71
    }
72
}