| Conditions | 3 |
| Paths | 3 |
| Total Lines | 14 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 3.0261 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 22 | 12 | protected function deserialize($data, string $classname): ?object |
|
| 23 | { |
||
| 24 | 12 | $object = null; |
|
| 25 | |||
| 26 | 12 | if ($data != '') { |
|
| 27 | 6 | $object = $this->serializer->deserialize((string)$data); |
|
| 28 | |||
| 29 | 6 | if (!($object instanceof $classname)) { |
|
| 30 | // Do not generate error, just ignore not correct value. |
||
| 31 | $object = null; |
||
| 32 | } |
||
| 33 | } |
||
| 34 | |||
| 35 | 12 | return $object; |
|
| 36 | } |
||
| 38 |