Total Complexity | 3 |
Total Lines | 34 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
21 | class CondensedUuidIdentity extends AbstractUuidIdentity |
||
22 | { |
||
23 | /** |
||
24 | * {@inheritdoc} |
||
25 | */ |
||
26 | final public static function fromString(string $value) |
||
27 | { |
||
28 | try { |
||
29 | static::uuidFromString(\sprintf('%s%s-%s-%s-%s-%s%s%s', ...\str_split($value, 4))); |
||
30 | } catch (\Exception $exception) { |
||
31 | throw new InvalidIdentityException( |
||
32 | \sprintf('Provided identity value "%s" is not a valid condensed UUID.', $value), |
||
33 | 0, |
||
34 | $exception |
||
35 | ); |
||
36 | } |
||
37 | |||
38 | return new static($value); |
||
39 | } |
||
40 | |||
41 | /** |
||
42 | * Get identity from UUID string. |
||
43 | * |
||
44 | * @param string $value |
||
45 | * |
||
46 | * @throws InvalidIdentityException |
||
47 | * |
||
48 | * @return mixed|static |
||
49 | */ |
||
50 | final public static function fromUuid(string $value) |
||
55 | } |
||
56 | } |
||
57 |