Conditions | 2 |
Paths | 2 |
Total Lines | 11 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php |
||
30 | 5 | public static function fromString(Str $value): Constructor |
|
31 | { |
||
32 | 5 | if (!$value->matches('~^map<\S+, ?\S+>$~')) { |
|
33 | 4 | throw new ValueNotSupported((string) $value); |
|
34 | } |
||
35 | |||
36 | 3 | $components = $value->capture('~^map<(?<key>\S+), ?(?<value>\S+)>$~'); |
|
37 | |||
38 | 3 | return new self( |
|
39 | 3 | (string) $components->get('key'), |
|
40 | 3 | (string) $components->get('value') |
|
41 | ); |
||
61 |