Conditions | 2 |
Paths | 2 |
Total Lines | 10 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
1 | <?php |
||
35 | public function normalize($object, $format = null, array $context = array()) |
||
36 | { |
||
37 | if (array_key_exists('field_name', $context)) { |
||
38 | return [ |
||
39 | $context['field_name'] => $object->getReference(), |
||
40 | ]; |
||
41 | } else { |
||
42 | throw new \LogicException(sprintf('No normalizer found for object of class "%s"', get_class($object))); |
||
43 | } |
||
44 | } |
||
45 | |||
54 |