Completed
Push — master ( 4a04e3...83688f )
by Changwan
03:47
created

RawExpression   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 34
ccs 8
cts 8
cp 1
rs 10
c 0
b 0
f 0
wmc 3
lcom 0
cbo 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A toSql() 0 4 1
A getBindings() 0 4 1
1
<?php
2
namespace Wandu\Database\Query\Expression;
3
4
use Wandu\Database\Contracts\ExpressionInterface;
5
6
class RawExpression implements ExpressionInterface 
7
{
8
    /** @var string */
9
    protected $expression;
10
    
11
    /** @var array */
12
    protected $bindings;
13
    
14
    /**
15
     * @param string $expression
16
     * @param array $bindings
17
     */
18 3
    public function __construct($expression, array $bindings = [])
19
    {
20 3
        $this->expression = $expression;
21 3
        $this->bindings = $bindings;
22 3
    }
23
24
    /**
25
     * @return string
26
     */
27 3
    public function toSql()
28
    {
29 3
        return $this->expression;
30
    }
31
32
    /**
33
     * @return array
34
     */
35 1
    public function getBindings()
36
    {
37 1
        return $this->bindings;
38
    }
39
}
40