| Total Complexity | 4 |
| Total Lines | 25 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 12 | class EnvelopeNormalizer implements NormalizerInterface, DenormalizerInterface |
||
| 13 | { |
||
| 14 | public function normalize($object, $format = null, array $context = []) |
||
| 15 | { |
||
| 16 | /* @var Envelope $object */ |
||
| 17 | |||
| 18 | return [ |
||
| 19 | 'type' => $object->messageType(), |
||
| 20 | 'message' => $object->serializedMessage(), |
||
| 21 | ]; |
||
| 22 | } |
||
| 23 | |||
| 24 | public function denormalize($data, $class, $format = null, array $context = []) |
||
| 27 | } |
||
| 28 | |||
| 29 | public function supportsNormalization($data, $format = null): bool |
||
| 30 | { |
||
| 31 | return $data instanceof Envelope; |
||
| 32 | } |
||
| 33 | |||
| 34 | public function supportsDenormalization($data, $type, $format = null): bool |
||
| 37 | } |
||
| 38 | } |
||
| 39 |