Failed Conditions
Pull Request — master (#106)
by
unknown
02:31
created

Raw   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 5
dl 0
loc 18
ccs 7
cts 7
cp 1
rs 10
c 0
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getValue() 0 3 1
A needsEncoding() 0 3 1
A __construct() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace ClickHouseDB\Query\Expression;
6
7
/**
8
 * Pass expression "as is" to be sent and executed at server.
9
 * P.ex.: `new Expression\Raw("UUIDStringToNum('0f372656-6a5b-4727-a4c4-f6357775d926')");`
10
 */
11
class Raw implements Expression
12
{
13
    /** @var string */
14
    private $expression;
15
16 2
    public function __construct(string $expression)
17
    {
18 2
        $this->expression = $expression;
19 2
    }
20
21 1
    public function needsEncoding(): bool
0 ignored issues
show
introduced by
There must be exactly 1 whitespace between closing parenthesis and return type colon.
Loading history...
22
    {
23 1
        return false;
24
    }
25
26 2
    public function getValue(): string
0 ignored issues
show
introduced by
There must be exactly 1 whitespace between closing parenthesis and return type colon.
Loading history...
27
    {
28 2
        return $this->expression;
29
    }
30
}
31