Documentation

ContextAwareDecoderInterface extends DecoderInterface

Adds the support of an extra $context parameter for the supportsDecoding method.

Tags
author

Kévin Dunglas dunglas@gmail.com

Table of Contents

Methods

decode()  : mixed
Decodes a string into PHP data.
supportsDecoding()  : bool
Checks whether the deserializer can decode from 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

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
bool

        
On this page

Search results