Completed
Push — master ( b54f87...bde51f )
by Beniamin
04:50
created

GroupByClauseTrait   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 27
c 0
b 0
f 0
wmc 2
lcom 1
cbo 0
ccs 5
cts 5
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A addGroupBy() 0 6 1
A getGroupByClauses() 0 4 1
1
<?php
2
3
/**
4
 * This file is part of Phuria SQL Builder 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\SQLBuilder\QueryBuilder\Clause;
13
14
/**
15
 * @author Beniamin Jonatan Šimko <[email protected]>
16
 */
17
trait GroupByClauseTrait
18
{
19
    /**
20
     * @var array $groupByClauses
21
     */
22
    private $groupByClauses = [];
23
24
    /**
25
     * @param string $clause
26
     *
27
     * @return $this
28
     */
29 3
    public function addGroupBy($clause)
30
    {
31 3
        $this->groupByClauses[] = $clause;
32
33 3
        return $this;
34
    }
35
36
    /**
37
     * @return array
38
     */
39 22
    public function getGroupByClauses()
40
    {
41 22
        return $this->groupByClauses;
42
    }
43
}