YamlFormatter
extends AbstractFormatter
in package
Class YamlFormatter
Table of Contents
Methods
- __construct() : mixed
- YamlFormatter constructor.
- __serialize() : array<string|int, mixed>
- __unserialize() : void
- decode() : mixed
- Decode a string into data.
- encode() : string
- Encode data into a string.
- getDefaultFileExtension() : string
- Get default file extension from current formatter (with dot).
- getIndentOption() : int
- getInlineOption() : int
- getMimeType() : string
- getSupportedFileExtensions() : array<string|int, string>
- Get file extensions supported by current formatter (with dot).
- serialize() : string
- unserialize() : void
- useCompatibleDecoder() : bool
- useNativeDecoder() : bool
- getConfig() : mixed
- Get either full configuration or a single option.
- getUnserializeAllowedClasses() : array<string|int, mixed>|bool
Methods
__construct()
YamlFormatter constructor.
public
__construct([array<string|int, mixed> $config = [] ]) : mixed
Parameters
- $config : array<string|int, mixed> = []
__serialize()
public
__serialize() : array<string|int, mixed>
Return values
array<string|int, mixed>__unserialize()
public
__unserialize(array<string|int, mixed> $data) : void
Parameters
- $data : array<string|int, mixed>
decode()
Decode a string into data.
public
decode(mixed $data) : mixed
Parameters
- $data : mixed
-
String to be decoded.
Tags
Return values
mixed —Returns decoded data.
encode()
Encode data into a string.
public
encode(array<string|int, mixed> $data[, int|null $inline = null ][, int|null $indent = null ]) : string
Parameters
- $data : array<string|int, mixed>
- $inline : int|null = null
- $indent : int|null = null
Tags
Return values
stringgetDefaultFileExtension()
Get default file extension from current formatter (with dot).
public
getDefaultFileExtension() : string
Tags
Return values
string —Returns file extension (can be empty).
getIndentOption()
public
getIndentOption() : int
Return values
intgetInlineOption()
public
getInlineOption() : int
Return values
intgetMimeType()
public
getMimeType() : string
Return values
stringgetSupportedFileExtensions()
Get file extensions supported by current formatter (with dot).
public
getSupportedFileExtensions() : array<string|int, string>
Tags
Return values
array<string|int, string> —Returns list of all supported file extensions.
serialize()
public
final serialize() : string
Return values
stringunserialize()
public
final unserialize(string $serialized) : void
Parameters
- $serialized : string
useCompatibleDecoder()
public
useCompatibleDecoder() : bool
Return values
booluseNativeDecoder()
public
useNativeDecoder() : bool
Return values
boolgetConfig()
Get either full configuration or a single option.
protected
getConfig([string|null $name = null ]) : mixed
Parameters
- $name : string|null = null
-
Configuration option (optional)
getUnserializeAllowedClasses()
protected
getUnserializeAllowedClasses() : array<string|int, mixed>|bool