Passed
Pull Request — master (#20)
by Glynn
02:17
created

Raw::getValue()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
c 0
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
namespace Pixie\QueryBuilder;
4
5
class Raw
6
{
7
    /**
8
     * @var string
9
     */
10
    protected $value;
11
12
    /**
13
     * @var mixed[]
14
     */
15
    protected $bindings;
16
17
    /**
18
     * @param string $value
19
     * @param mixed|mixed[] $bindings
20
     */
21
    public function __construct($value, $bindings = [])
22
    {
23
        $this->value    = (string)$value;
24
        $this->bindings = (array)$bindings;
25
    }
26
27
    /**
28
     * Returns the current bindings
29
     *
30
     * @return mixed[]
31
     */
32
    public function getBindings(): array
33
    {
34
        return $this->bindings;
35
    }
36
37
    /**
38
     * Returns the current value held.
39
     *
40
     * @return string
41
     */
42
    public function getValue(): string
43
    {
44
        return (string) $this->value;
45
    }
46
47
    /**
48
     * @return string
49
     */
50
    public function __toString()
51
    {
52
        return (string)$this->value;
53
    }
54
}
55