Expression   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A __toString() 0 3 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
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