Conditions | 2 |
Paths | 2 |
Total Lines | 14 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
29 | public function arrayToObject(array $array): ?stdClass |
||
30 | { |
||
31 | try { |
||
32 | return json_decode( |
||
33 | json_encode($array, JSON_THROW_ON_ERROR), |
||
34 | false, |
||
35 | 512, |
||
36 | JSON_THROW_ON_ERROR |
||
37 | ); |
||
38 | } catch (Exception $e) { |
||
39 | throw new ParseErrorException( |
||
40 | $e->getMessage(), |
||
41 | $e->getCode(), |
||
42 | $e->getPrevious() |
||
43 | ); |
||
47 |