class Serializer implements DecoderInterface, EncoderInterface
__construct(SerializerInterface $serializer, string $format = 'json', array $context = array()) | ||
Envelope | decode(array $encodedEnvelope) Decodes an envelope and its message from an encoded-form. | |
array | encode(Envelope $envelope) Encodes an envelope content (message & items) to a common format understandable by transports. |
SerializerInterface | $serializer | |
string | $format | |
array | $context |
Decodes an envelope and its message from an encoded-form.
The $encodedEnvelope
parameter is a key-value array that describes the envelope and its content, that will be used by the different transports.
The most common keys are: - body
(string) - the message body - headers
(string
array | $encodedEnvelope |
Envelope |
Encodes an envelope content (message & items) to a common format understandable by transports.
The encoded array should only contain scalar and arrays.
The most common keys of the encoded array are: - body
(string) - the message body - headers
(string
Envelope | $envelope | The envelop containing the message put on the MessageBus by the user |
array |
© 2004–2017 Fabien Potencier
Licensed under the MIT License.
https://api.symfony.com/4.1/Symfony/Component/Messenger/Transport/Serialization/Serializer.html