mediatekformation

YamlEncoder
in package
implements EncoderInterface, DecoderInterface

Encodes YAML data.

Tags
author

Kévin Dunglas dunglas@gmail.com

Interfaces, Classes, Traits and Enums

EncoderInterface
DecoderInterface

Table of Contents

FORMAT  = 'yaml'
PRESERVE_EMPTY_OBJECTS  = 'preserve_empty_objects'
ALTERNATIVE_FORMAT  = 'yml'
$defaultContext  : mixed
$dumper  : mixed
$parser  : mixed
__construct()  : mixed
decode()  : mixed
Decodes a string into PHP data.
encode()  : string
Encodes data into the given format.
supportsDecoding()  : bool
Checks whether the deserializer can decode from given format.
supportsEncoding()  : bool
Checks whether the serializer can encode to given format.

Constants

PRESERVE_EMPTY_OBJECTS

public mixed PRESERVE_EMPTY_OBJECTS = 'preserve_empty_objects'

ALTERNATIVE_FORMAT

private mixed ALTERNATIVE_FORMAT = 'yml'

Properties

$defaultContext

private mixed $defaultContext = ['yaml_inline' => 0, 'yaml_indent' => 0, 'yaml_flags' => 0]

Methods

__construct()

public __construct([Dumper $dumper = null ][, Parser $parser = null ][, array<string|int, mixed> $defaultContext = [] ]) : mixed
Parameters
$dumper : Dumper = null
$parser : Parser = null
$defaultContext : array<string|int, mixed> = []
Return values
mixed

decode()

Decodes a string into PHP data.

public decode(mixed $data, mixed $format[, array<string|int, mixed> $context = [] ]) : mixed
Parameters
$data : mixed

Data to decode

$format : mixed

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.

Return values
mixed

encode()

Encodes data into the given format.

public encode(mixed $data, mixed $format[, array<string|int, mixed> $context = [] ]) : string
Parameters
$data : mixed

Data to encode

$format : mixed

Format name

$context : array<string|int, mixed> = []

Options that normalizers/encoders have access to

Return values
string

supportsDecoding()

Checks whether the deserializer can decode from given format.

public supportsDecoding(mixed $format) : bool
Parameters
$format : mixed

Format name

Return values
bool

supportsEncoding()

Checks whether the serializer can encode to given format.

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

Format name

Return values
bool

Search results