| Conditions | 3 |
| Paths | 3 |
| Total Lines | 13 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 28 | 5 | public function denormalize($data, $class, string $selector = 'auto') |
|
| 29 | { |
||
| 30 | 5 | $serializer = $this->getSerializer($selector); |
|
| 31 | |||
| 32 | 5 | if (null === $serializer) { |
|
| 33 | 2 | throw new \Exception('unknow serializer'); |
|
| 34 | } |
||
| 35 | |||
| 36 | 3 | if ($serializer instanceof JMSSerializer) { |
|
| 37 | 2 | return $serializer->fromArray($data, $class); |
|
| 38 | } |
||
| 39 | |||
| 40 | 1 | return $serializer->denormalize($data, $class); |
|
| 41 | } |
||
| 64 |