| Conditions | 3 |
| Paths | 3 |
| Total Lines | 18 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 12 |
| Changes | 0 | ||
| 1 | <?php |
||
| 42 | public function normalizeField( |
||
| 43 | string $path, |
||
| 44 | $object, |
||
| 45 | NormalizerContextInterface $context, |
||
| 46 | NormalizerInterface $normalizer = null |
||
| 47 | ) { |
||
| 48 | if (null === $normalizer) { |
||
| 49 | throw SerializerLogicException::createMissingNormalizer($path); |
||
| 50 | } |
||
| 51 | |||
| 52 | $data = []; |
||
| 53 | foreach ($this->accessor->getValue($object) as $i => $childObject) { |
||
| 54 | $subPath = $path.'['.$i.']'; |
||
| 55 | $data[$i] = $normalizer->normalize($childObject, $context, $subPath); |
||
| 56 | } |
||
| 57 | |||
| 58 | return $data; |
||
| 59 | } |
||
| 60 | } |
||
| 61 |