| Total Complexity | 2 |
| Total Lines | 28 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 14 | class CommentNormalizer implements NormalizerInterface, NormalizerAwareInterface |
||
| 15 | { |
||
| 16 | use NormalizerAwareTrait; |
||
| 17 | |||
| 18 | /** |
||
| 19 | * {@inheritdoc} |
||
| 20 | */ |
||
| 21 | public function normalize($object, $format = null, array $context = []) |
||
| 22 | { |
||
| 23 | /* @var Article $object */ |
||
| 24 | |||
| 25 | $data = [ |
||
| 26 | 'id' => $object->getId(), |
||
| 27 | 'createdAt' => $this->normalizer->normalize($object->getCreatedAt()), |
||
| 28 | 'updatedAt' => $this->normalizer->normalize($object->getCreatedAt()), |
||
| 29 | 'body' => $object->getBody(), |
||
| 30 | 'author' => $this->normalizer->normalize($object->getAuthor()), |
||
| 31 | ]; |
||
| 32 | |||
| 33 | return $data; |
||
| 34 | } |
||
| 35 | |||
| 36 | /** |
||
| 37 | * {@inheritdoc} |
||
| 38 | */ |
||
| 39 | public function supportsNormalization($data, $format = null) |
||
| 42 | } |
||
| 43 | } |
||
| 44 |