class YamlParser extends AbstractParser
YAML parser.
Converts data between associative array and YAML formats
Methods
string |
fromArray(array $array)
Converts data from an associative array to YAML. |
|
array |
toArray(string $data)
Converts data from YAML to an associative array. |
|
listFromArray($data) | from AbstractParser | |
listToArray($data) | from AbstractParser | |
string |
load(string $path)
Loads data from a file. |
from AbstractParser |
dump(string $data, string $path = null)
Dumps data to a file, or to STDOUT if no filename is given |
from AbstractParser | |
static AbstractParser |
getParser(string $type = 'XML')
Factory for getting an instance of a subclass of AbstractParser |
from AbstractParser |
string |
toYAML(array $array)
Alias for YamlParser::fromArray() |
|
array |
fromYAML(string $data)
Alias for YamlParser::toArray() |
Details
at line 28
public string
fromArray(array $array)
Converts data from an associative array to YAML.
at line 50
public array
toArray(string $data)
Converts data from YAML to an associative array.
in AbstractParser at line 43
public
listFromArray($data)
in AbstractParser at line 48
public
listToArray($data)
in AbstractParser at line 60
public string
load(string $path)
Loads data from a file.
Executes PHP code blocks in the file.
in AbstractParser at line 79
public
dump(string $data, string $path = null)
Dumps data to a file, or to STDOUT if no filename is given
in AbstractParser at line 95
static public AbstractParser
getParser(string $type = 'XML')
Factory for getting an instance of a subclass of AbstractParser
at line 39
public string
toYAML(array $array)
Alias for YamlParser::fromArray()
at line 61
public array
fromYAML(string $data)
Alias for YamlParser::toArray()