| Conditions | 3 |
| Paths | 3 |
| Total Lines | 14 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 3 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 31 | 17 | public static function fromValue($value): Argument |
|
| 32 | { |
||
| 33 | 17 | if (!is_string($value)) { |
|
| 34 | 1 | throw new ValueNotSupported; |
|
| 35 | } |
||
| 36 | |||
| 37 | 16 | $value = Str::of($value); |
|
| 38 | |||
| 39 | 16 | if ((string) $value->substring(0, 1) !== '$') { |
|
| 40 | 1 | throw new ValueNotSupported((string) $value); |
|
| 41 | } |
||
| 42 | |||
| 43 | 15 | return new self(new Name( |
|
| 44 | 15 | (string) $value->substring(1) |
|
| 45 | )); |
||
| 72 |