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