| Conditions | 2 |
| Paths | 2 |
| Total Lines | 11 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 43 | 15 | public static function fromString(Str $value): Type |
|
| 44 | { |
||
| 45 | 15 | if (!$value->matches(self::PATTERN)) { |
|
| 46 | 13 | throw new ValueNotSupported((string) $value); |
|
| 47 | } |
||
| 48 | |||
| 49 | 2 | $components = $value->capture(self::PATTERN); |
|
| 50 | |||
| 51 | 2 | return new self( |
|
| 52 | 2 | (string) $components->get('key'), |
|
| 53 | 2 | (string) $components->get('value') |
|
| 54 | ); |
||
| 65 |