Completed
Push — master ( 42a15b...d491ac )
by Paweł
02:03
created

UuidConverter::convert()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
c 2
b 0
f 0
dl 0
loc 8
rs 9.4286
cc 2
eloc 5
nc 2
nop 1
1
<?php
2
3
namespace Clearcode\CommandBusConsole\ValueConverter;
4
5
use Ramsey\Uuid\Uuid;
6
7
class UuidConverter implements ValueConverter
8
{
9
    public function convert($rawValue)
10
    {
11
        try {
12
            return Uuid::fromString($rawValue);
13
        } catch (\Exception $e) {
14
            return;
15
        }
16
    }
17
}
18