class Serializer implements SerializerInterface

Constants

STAMP_HEADER_PREFIX

Methods

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

No description

static Serializer
create()

No description

decode(array $encodedEnvelope)

Decodes an envelope and its message from an encoded-form.

array
encode(Envelope $envelope)

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

Details

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

Parameters

SerializerInterface $serializer
string $format
array $context

static Serializer create()

Return Value

Serializer

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

array encode(Envelope $envelope)

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

The encoded array should only contain scalars 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

Return Value

array