Failed Conditions
Pull Request — master (#106)
by
unknown
02:08
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
use function sprintf;
8
9
/**
10
 * Pass expression "as is" to be sent and executed at server.
11
 * P.ex.: `new Expression\Function\UUIDStringToNum('0f372656-6a5b-4727-a4c4-f6357775d926');`
12
 */
13
class UUIDStringToNum implements Expression
14
{
15
    /** @var string */
16
    private $uuid;
17
18
    public function __construct(string $uuid)
19
    {
20
        $this->$uuid = $uuid;
21
    }
22
23
    public function needsEncoding() : bool
24
    {
25
        return false;
26
    }
27
28
    public function getValue() : string
29
    {
30
        return sprintf("UUIDStringToNum('%s')", $this->uuid);
31
    }
32
}
33