Documentation

CommandEncoder
in package
implements EncoderInterface, DecoderInterface

Interfaces, Classes, Traits and Enums

EncoderInterface
DecoderInterface

Table of Contents

decode()  : mixed
Decodes a string into PHP data.
encode()  : string|int|float|bool
Encodes data into the given format.
supportsDecoding()  : bool
Checks whether the deserializer can decode from given format.
supportsEncoding()  : bool
Checks whether the serializer can encode to given format.

Methods

decode()

Decodes a string into PHP data.

public decode(string $data, string $format[, array<string|int, mixed> $context = [] ]) : mixed
Parameters
$data : string

Data to decode

$format : string

Format name

$context : array<string|int, mixed> = []

Options that decoders have access to

The format parameter specifies which format the data is in; valid values depend on the specific implementation. Authors implementing this interface are encouraged to document which formats they support in a non-inherited phpdoc comment.

Tags
throws
UnexpectedValueException
Return values
mixed

encode()

Encodes data into the given format.

public encode(mixed $data, string $format[, array<string|int, mixed> $context = [] ]) : string|int|float|bool
Parameters
$data : mixed

Data to encode

$format : string

Format name

$context : array<string|int, mixed> = []

Options that normalizers/encoders have access to

Tags
throws
UnexpectedValueException
Return values
string|int|float|bool

supportsDecoding()

Checks whether the deserializer can decode from given format.

public supportsDecoding(string $format) : bool
Parameters
$format : string

Format name

Return values
bool

supportsEncoding()

Checks whether the serializer can encode to given format.

public supportsEncoding(string $format) : bool
Parameters
$format : string

Format name

Return values
bool

Search results