UUIDStringToNum::getValue()   A
last analyzed

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 2
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\Func;
6
7
use ClickHouseDB\Query\Expression\Expression;
8
use function sprintf;
0 ignored issues
show
introduced by
Expected 1 lines between different types of use statement, found 0.
Loading history...
9
10
/**
11
 * Pass expression "as is" to be sent and executed at server.
12
 * P.ex.: `new Expression\Function\UUIDStringToNum('0f372656-6a5b-4727-a4c4-f6357775d926');`
13
 */
14
class UUIDStringToNum implements Expression
15
{
16
    /** @var string */
17
    private $uuid;
18
19
    public function __construct(string $uuid)
20
    {
21
        $this->uuid = $uuid;
22
    }
23
24
    public function needsEncoding() : bool
0 ignored issues
show
introduced by
There must be no whitespace between closing parenthesis and return type colon.
Loading history...
25
    {
26
        return false;
27
    }
28
29
    public function getValue() : string
0 ignored issues
show
introduced by
There must be no whitespace between closing parenthesis and return type colon.
Loading history...
30
    {
31
        return sprintf("UUIDStringToNum('%s')", $this->uuid);
32
    }
33
}
34