| Conditions | 3 |
| Paths | 3 |
| Total Lines | 11 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 15 | private function encode($decodedJsonData): string |
||
| 16 | { |
||
| 17 | try { |
||
| 18 | $encoded = json_encode($decodedJsonData); |
||
| 19 | } catch (Throwable $exception) { |
||
| 20 | throw InputDataCannotBeEncoded::encountered($exception); |
||
| 21 | } |
||
| 22 | if (json_last_error() !== JSON_ERROR_NONE) { |
||
| 23 | throw InputDataCannotBeEncoded::found(json_last_error_msg()); |
||
| 24 | } |
||
| 25 | return $encoded; |
||
| 26 | } |
||
| 29 |