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

UUIDStringToNum::getValue()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 0
cts 3
cp 0
crap 2
rs 10
c 0
b 0
f 0
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\Function\UUIDStringToNum('0f372656-6a5b-4727-a4c4-f6357775d926');`
10
 */
11
class UUIDStringToNum implements Expression
12
{
13
    /** @var string */
14
    private $uuid;
15
16
    public function __construct(string $uuid)
17
    {
18
        $this->$uuid = $uuid;
19
    }
20
21
    public function needsEncoding() : bool
22
    {
23
        return false;
24
    }
25
26
    public function getValue() : string
27
    {
28
        return \sprintf("UUIDStringToNum('%s')", $this->uuid);
0 ignored issues
show
introduced by
Function \sprintf() should not be referenced via a fully qualified name, but via a use statement.
Loading history...
29
    }
30
}
31