Expression::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
c 0
b 0
f 0
nc 1
nop 2
dl 0
loc 4
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
16
    use FactoryTrait;
17
18
    /**
19
     * @var DB
20
     */
21
    protected $db;
22
23
    /**
24
     * @var string
25
     */
26
    protected $expression;
27
28
    /**
29
     * @param DB $db
30
     * @param string $expression
31
     */
32
    public function __construct(DB $db, string $expression)
33
    {
34
        $this->db = $db;
35
        $this->expression = $expression;
36
    }
37
38
    /**
39
     * @return string
40
     */
41
    public function __toString()
42
    {
43
        return $this->expression;
44
    }
45
}
46