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