Conditions | 2 |
Paths | 2 |
Total Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Tests | 5 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php |
||
14 | 7 | public function serialize($var, Normalizers $normalizers, NormalizerContextInterface $context) |
|
15 | { |
||
16 | 7 | $json = @json_encode($this->doSerialize($var, $normalizers, $context)); |
|
17 | |||
18 | 5 | if(json_last_error() !== JSON_ERROR_NONE) { |
|
19 | 1 | throw SerializationFailureException::fromJson(json_last_error_msg()); |
|
20 | } |
||
21 | |||
22 | 4 | return $json; |
|
23 | } |
||
24 | |||
30 |