Completed
Push — master ( d1533d...b79559 )
by Jared
02:59 queued 40s
created

SqlQuery   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 46
Duplicated Lines 0 %

Coupling/Cohesion

Components 2
Dependencies 2

Importance

Changes 3
Bugs 0 Features 1
Metric Value
wmc 4
c 3
b 0
f 1
lcom 2
cbo 2
dl 0
loc 46
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A initialize() 0 4 1
A raw() 0 6 1
A parameters() 0 6 1
A build() 0 4 1
1
<?php
2
3
/**
4
 * @author Jared King <[email protected]>
5
 *
6
 * @link http://jaredtking.com
7
 *
8
 * @copyright 2015 Jared King
9
 * @license MIT
10
 */
11
namespace JAQB\Query;
12
13
class SqlQuery extends Query
14
{
15
    use SelectableTrait;
16
17
    /**
18
     * @var string
19
     */
20
    protected $sql;
21
22
    public function initialize()
23
    {
24
        // NOOP
25
    }
26
27
    /**
28
     * Sets the SQL for the query.
29
     *
30
     * @param string $sql
31
     *
32
     * @return self
33
     */
34
    public function raw($sql)
35
    {
36
        $this->sql = $sql;
37
38
        return $this;
39
    }
40
41
    /**
42
     * Sets the parameters for this query to be injected into
43
     * the prepared statement.
44
     *
45
     * @return self
46
     */
47
    public function parameters(array $values)
48
    {
49
        $this->values = $values;
50
51
        return $this;
52
    }
53
54
    public function build()
55
    {
56
        return $this->sql;
57
    }
58
}
59