Completed
Push — master ( 12c942...31d87d )
by Beniamin
02:36
created

SelectClauseTrait::doAddSelect()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 3
cts 3
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
crap 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 SelectClauseTrait
18
{
19
    /**
20
     * @var array $selectClauses
21
     */
22
    private $selectClauses = [];
23
24
    /**
25
     * @return $this
26
     */
27 25
    public function addSelect()
28
    {
29 25
        foreach (func_get_args() as $clause) {
30 25
            $this->doAddSelect($clause);
31 25
        }
32
33 25
        return $this;
34
    }
35
36
    /**
37
     * @param string $clause
38
     */
39 25
    private function doAddSelect($clause)
40
    {
41 25
        $this->selectClauses[] = $clause;
42 25
    }
43
44
    /**
45
     * @return array
46
     */
47 25
    public function getSelectClauses()
48
    {
49 25
        return $this->selectClauses;
50
    }
51
}