Conditions | 2 |
Paths | 2 |
Total Lines | 9 |
Code Lines | 4 |
Lines | 0 |
Ratio | 0 % |
Tests | 5 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php |
||
28 | 15 | public static function fromString(Str $value): Constructor |
|
29 | { |
||
30 | 15 | if (!$value->matches('~^set<\S+>$~')) { |
|
31 | 11 | throw new ValueNotSupported((string) $value); |
|
32 | } |
||
33 | |||
34 | 9 | $components = $value->capture('~^set<(?<type>\S+)>$~'); |
|
35 | |||
36 | 9 | return new self((string) $components->get('type')); |
|
37 | } |
||
57 |