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