| Conditions | 3 |
| Paths | 3 |
| Total Lines | 13 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 29 | 7 | public function load(Str $value): Constructor |
|
| 30 | { |
||
| 31 | 7 | foreach ($this->constructors as $constructor) { |
|
| 32 | try { |
||
| 33 | 7 | $build = $constructor.'::fromString'; |
|
| 34 | |||
| 35 | 7 | return $build($value); |
|
| 36 | 6 | } catch (ValueNotSupported $e) { |
|
| 37 | //pass |
||
| 38 | } |
||
| 39 | } |
||
| 40 | |||
| 41 | 1 | throw new ValueNotSupported(var_export($value, true)); |
|
| 42 | } |
||
| 59 |