Conditions | 3 |
Paths | 3 |
Total Lines | 15 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Tests | 3 |
CRAP Score | 3 |
Changes | 2 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
32 | public function normalizeField( |
||
33 | string $path, |
||
34 | $object, |
||
35 | NormalizerContextInterface $context, |
||
36 | NormalizerInterface $normalizer = null |
||
37 | ) { |
||
38 | 3 | if (null === $normalizer) { |
|
39 | throw SerializerLogicException::createMissingNormalizer($path); |
||
40 | } |
||
41 | |||
42 | if (null === $relatedObject = $this->accessor->getValue($object)) { |
||
43 | return null; |
||
44 | 3 | } |
|
45 | 1 | ||
46 | return $normalizer->normalize($relatedObject, $context, $path); |
||
47 | } |
||
49 |