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