RawQuery::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 2
dl 0
loc 5
ccs 0
cts 5
cp 0
crap 2
rs 9.4285
c 0
b 0
f 0
1
<?php
2
namespace Wandu\Database\Query;
3
4
use Wandu\Database\Contracts\QueryInterface;
5
6
class RawQuery implements QueryInterface
7
{
8
    /** @var string */
9
    protected $query;
10
11
    /** @var array */
12
    protected $bindings;
13
14
    /**
15
     * @param string $query
16
     * @param array $bindings
17
     */
18
    public function __construct($query, array $bindings = [])
19
    {
20
        $this->query = $query;
21
        $this->bindings = $bindings;
22
    }
23
24
    /**
25
     * @return string
26
     */
27
    public function toSql()
28
    {
29
        return $this->query;
30
    }
31
32
    /**
33
     * @return array
34
     */
35
    public function getBindings()
36
    {
37
        return $this->bindings;
38
    }
39
}
40