DecoderInterface
in
Tags
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
supportsDecoding()
Checks whether the deserializer can decode from given format.
public
supportsDecoding(string $format) : bool
Parameters
- $format : string
-
Format name