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