Conditions | 3 |
Paths | 3 |
Total Lines | 15 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 3.0175 |
Changes | 0 |
1 | <?php |
||
31 | 42 | public function denormalize($data, $class, $format = null, array $context = array()) |
|
32 | { |
||
33 | 42 | if (!$this->serializer instanceof DenormalizerInterface) { |
|
34 | throw new LogicException('Cannot denormalize because the injected serializer is not a denormalizer.'); |
||
35 | } |
||
36 | |||
37 | 42 | $id = $this->serializer->denormalize($data['id'], 'Xabbuh\XApi\Model\IRI', $format, $context); |
|
38 | 42 | $display = null; |
|
39 | |||
40 | 42 | if (isset($data['display'])) { |
|
41 | 40 | $display = $this->serializer->denormalize($data['display'], 'Xabbuh\XApi\Model\LanguageMap', $format, $context); |
|
42 | } |
||
43 | |||
44 | 42 | return new Verb($id, $display); |
|
45 | } |
||
46 | |||
55 |