Documentation

SerializerInterface

Tags
author

Samuel Roze samuel.roze@gmail.com

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
throws
MessageDecodingFailedException
Return values
Envelope

encode()

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
Return values
array<string|int, mixed>

        
On this page

Search results