Documentation

EncoderInterface

Tags
author

Jordi Boggiano j.boggiano@seld.be

Table of Contents

Methods

encode()  : string
Encodes data into the given format.
supportsEncoding()  : bool
Checks whether the serializer can encode to given format.

Methods

encode()

Encodes data into the given format.

public encode(mixed $data, string $format[, array<string|int, mixed> $context = [] ]) : string
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

supportsEncoding()

Checks whether the serializer can encode to given format.

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

Format name

Return values
bool

        
On this page

Search results