Total Complexity | 3 |
Total Lines | 21 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php declare(strict_types=1); |
||
8 | class AnswerNormalizer implements NormalizerInterface |
||
9 | { |
||
10 | /** |
||
11 | * @inheritdoc |
||
12 | */ |
||
13 | public function normalize($answer, $format = null, array $context = []): array |
||
14 | { |
||
15 | /** @var Answer $answer */ |
||
16 | return [ |
||
17 | 'id' => $answer->getId()->toString(), |
||
18 | 'text' => $answer->getText()->toNative(), |
||
19 | 'correct' => $answer->isCorrect(), |
||
20 | ]; |
||
21 | } |
||
22 | |||
23 | /** |
||
24 | * @inheritdoc |
||
25 | */ |
||
26 | public function supportsNormalization($data, $format = null): bool |
||
29 | } |
||
30 | } |
||
31 |