RamseyBinaryUuidTransformer   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 9
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 2
eloc 4
dl 0
loc 9
ccs 0
cts 4
cp 0
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A transformToString() 0 7 2
1
<?php
2
declare(strict_types=1);
3
4
namespace ReadModel\Bridge\Ramsey;
5
6
use Ramsey\Uuid\Uuid;
7
use ReadModel\Walker\BinaryUuidTransformer;
8
9
class RamseyBinaryUuidTransformer implements BinaryUuidTransformer
10
{
11
    public function transformToString($value): ?string
12
    {
13
        if (empty($value)) {
14
            return null;
15
        }
16
17
        return Uuid::fromBytes($value)->toString();
18
    }
19
}
20