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