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