Documentation

Serializer
in package
implements SerializerInterface

Tags
author

Samuel Roze samuel.roze@gmail.com

Table of Contents

Interfaces

SerializerInterface

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

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
self

decode()

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
Envelope

encode()

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>

getContentTypeHeader()

private getContentTypeHeader() : array<string|int, mixed>
Return values
array<string|int, mixed>

getMimeTypeForFormat()

private getMimeTypeForFormat() : string|null
Return values
string|null

        
On this page

Search results