Passed
Push — master ( 222f48...0fa176 )
by y
01:47
created

Expression   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 7
c 0
b 0
f 0
dl 0
loc 28
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A __toString() 0 2 1
1
<?php
2
3
namespace Helix\DB\Fluent;
4
5
use Helix\DB;
6
use Helix\DB\FactoryTrait;
7
8
/**
9
 * A literal expression, exempt from being quoted.
10
 *
11
 * @method static static factory(DB $db, string $expression)
12
 */
13
class Expression implements ExpressionInterface {
14
15
    use FactoryTrait;
16
17
    /**
18
     * @var DB
19
     */
20
    protected $db;
21
22
    /**
23
     * @var string
24
     */
25
    protected $expression;
26
27
    /**
28
     * @param DB $db
29
     * @param string $expression
30
     */
31
    public function __construct (DB $db, string $expression) {
32
        $this->db = $db;
33
        $this->expression = $expression;
34
    }
35
36
    /**
37
     * @return string
38
     */
39
    public function __toString () {
40
        return $this->expression;
41
    }
42
}
43