| Conditions | 2 |
| Paths | 2 |
| Total Lines | 12 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 2.3755 |
| Changes | 0 | ||
| 1 | <?php declare(strict_types = 1); |
||
| 42 | 2 | public function parseString(string $configuration): array |
|
| 43 | { |
||
| 44 | 2 | $array = json_decode($configuration, true); |
|
| 45 | 2 | if (json_last_error() !== JSON_ERROR_NONE) { |
|
| 46 | 1 | throw new \RuntimeException( |
|
| 47 | 1 | sprintf('Unable to parse configuration string: "%s".', json_last_error_msg()), |
|
| 48 | json_last_error() |
||
| 49 | ); |
||
| 50 | } |
||
| 51 | |||
| 52 | 2 | return $array; |
|
| 53 | } |
||
| 54 | |||
| 62 | } |