UUIDStringToNum   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 18
ccs 0
cts 6
cp 0
rs 10
c 0
b 0
f 0
wmc 3

3 Methods

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