Serializer
in package
implements
SerializerInterface
Tags
Table of Contents
Interfaces
Constants
- MESSENGER_SERIALIZATION_CONTEXT = 'messenger_serialization'
- STAMP_HEADER_PREFIX = 'X-Message-Stamp-'
Properties
- $context : array<string|int, mixed>
- $format : string
- $serializer : mixed
Methods
- __construct() : mixed
- create() : self
- 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.
- decodeStamps() : array<string|int, mixed>
- encodeStamps() : array<string|int, mixed>
- findFirstSerializerStamp() : SerializerStamp|null
- getContentTypeHeader() : array<string|int, mixed>
- getMimeTypeForFormat() : string|null
Constants
MESSENGER_SERIALIZATION_CONTEXT
public
mixed
MESSENGER_SERIALIZATION_CONTEXT
= 'messenger_serialization'
STAMP_HEADER_PREFIX
private
mixed
STAMP_HEADER_PREFIX
= 'X-Message-Stamp-'
Properties
$context
private
array<string|int, mixed>
$context
$format
private
string
$format
$serializer
private
mixed
$serializer
Methods
__construct()
public
__construct([SerializerInterface $serializer = null ][, string $format = 'json' ][, array<string|int, mixed> $context = [] ]) : mixed
Parameters
- $serializer : SerializerInterface = null
- $format : string = 'json'
- $context : array<string|int, mixed> = []
create()
public
static create() : self
Return values
selfdecode()
Decodes an envelope and its message from an encoded-form.
public
decode(array<string|int, mixed> $encodedEnvelope) : Envelope
Parameters
- $encodedEnvelope : array<string|int, mixed>
Return values
Envelopeencode()
Encodes an envelope content (message & stamps) to a common format understandable by transports.
public
encode(Envelope $envelope) : array<string|int, mixed>
Parameters
- $envelope : Envelope
Return values
array<string|int, mixed>decodeStamps()
private
decodeStamps(array<string|int, mixed> $encodedEnvelope) : array<string|int, mixed>
Parameters
- $encodedEnvelope : array<string|int, mixed>
Return values
array<string|int, mixed>encodeStamps()
private
encodeStamps(Envelope $envelope) : array<string|int, mixed>
Parameters
- $envelope : Envelope
Return values
array<string|int, mixed>findFirstSerializerStamp()
private
findFirstSerializerStamp(array<string|int, StampInterface> $stamps) : SerializerStamp|null
Parameters
- $stamps : array<string|int, StampInterface>
Return values
SerializerStamp|nullgetContentTypeHeader()
private
getContentTypeHeader() : array<string|int, mixed>
Return values
array<string|int, mixed>getMimeTypeForFormat()
private
getMimeTypeForFormat() : string|null