W3cubDocs

/Symfony 4.1

EncoderInterface

interface EncoderInterface

Methods

array encode(Envelope $envelope)

Encodes an envelope content (message & items) to a common format understandable by transports.

Details

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