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

Expression::__toString()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
c 0
b 0
f 0
nc 1
nop 0
dl 0
loc 2
rs 10
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