SerializerInterface
in
Tags
Table of Contents
Methods
- decode() : Envelope
- Decodes an envelope and its message from an encoded-form.
- encode() : array<string|int, mixed>
- Encodes an envelope content (message & stamps) to a common format understandable by transports.
Methods
decode()
Decodes an envelope and its message from an encoded-form.
public
decode(array<string|int, mixed> $encodedEnvelope) : Envelope
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
- $encodedEnvelope : array<string|int, mixed>
Tags
Return values
Envelopeencode()
Encodes an envelope content (message & stamps) to a common format understandable by transports.
public
encode(Envelope $envelope) : array<string|int, mixed>
The encoded array should only contain scalars and arrays.
Stamps that implement NonSendableStampInterface should not be encoded.
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