| 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); |
||
| 46 | 2 | public function parseString(string $configuration): array |
|
| 47 | { |
||
| 48 | 2 | $array = json_decode($configuration, true); |
|
| 49 | 2 | if (json_last_error() !== JSON_ERROR_NONE) { |
|
| 50 | 1 | throw new \RuntimeException( |
|
| 51 | 1 | sprintf('Unable to parse configuration string: "%s".', json_last_error_msg()), |
|
| 52 | json_last_error() |
||
| 53 | ); |
||
| 54 | } |
||
| 55 | |||
| 56 | 2 | return $array; |
|
| 57 | } |
||
| 58 | |||
| 66 | } |