ChainDecoder
in package
implements
ContextAwareDecoderInterface
Decoder delegating the decoding to a chain of decoders.
Tags
Interfaces, Classes, Traits and Enums
- ContextAwareDecoderInterface
- Adds the support of an extra $context parameter for the supportsDecoding method.
Table of Contents
- $decoderByFormat : mixed
- $decoders : mixed
- __construct() : mixed
- decode() : mixed
- {@inheritdoc}
- supportsDecoding() : bool
- Checks whether the deserializer can decode from given format.
- getDecoder() : DecoderInterface
- Gets the decoder supporting the format.
Properties
$decoderByFormat
protected
mixed
$decoderByFormat
= []
$decoders
protected
mixed
$decoders
= []
Methods
__construct()
public
__construct([array<string|int, mixed> $decoders = [] ]) : mixed
Parameters
- $decoders : array<string|int, mixed> = []
Return values
mixed —decode()
{@inheritdoc}
public
final decode(mixed $data, mixed $format[, array<string|int, mixed> $context = [] ]) : mixed
Parameters
- $data : mixed
- $format : mixed
- $context : array<string|int, mixed> = []
Return values
mixed —supportsDecoding()
Checks whether the deserializer can decode from given format.
public
supportsDecoding(mixed $format[, array<string|int, mixed> $context = [] ]) : bool
Parameters
- $format : mixed
-
Format name
- $context : array<string|int, mixed> = []
-
options that decoders have access to
Return values
bool —getDecoder()
Gets the decoder supporting the format.
private
getDecoder(string $format, array<string|int, mixed> $context) : DecoderInterface
Parameters
- $format : string
- $context : array<string|int, mixed>