class Serializer implements DecoderInterface, EncoderInterface

Methods

__construct(SerializerInterface $serializer, string $format = 'json', array $context = [])

No description

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.

Details

at line 26
__construct(SerializerInterface $serializer, string $format = 'json', array $context = [])

Parameters

SerializerInterface $serializer
string $format
array $context

at line 36
Envelope decode(array $encodedEnvelope)

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) - a key/value pair of headers

Parameters

array $encodedEnvelope

Return Value

Envelope

at line 62
array encode(Envelope $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) - a key/value pair of headers

Parameters

Envelope $envelope The envelop containing the message put on the MessageBus by the user

Return Value

array