Class Inline
Inline implements a YAML parser/dumper for the YAML inline syntax.
Methods summary
public static
array
|
#
parse( string $value, boolean $exceptionOnInvalidType = false, boolean $objectSupport = false, boolean $objectForMap = false, array $references = array() )
Converts a YAML string to a PHP array.
Converts a YAML string to a PHP array.
Parameters
- $value
- A YAML string
- $exceptionOnInvalidType
- true if an exception must be thrown on invalid types (a PHP resource or object), false otherwise
- $objectSupport
- true if object support is enabled, false otherwise
- $objectForMap
- true if maps should return a stdClass instead of array()
- $references
- Mapping of variable names to values
Returns
array A PHP array representing the YAML string
Throws
|
public static
string
|
#
dump( mixed $value, boolean $exceptionOnInvalidType = false, boolean $objectSupport = false )
Dumps a given PHP variable to a YAML string.
Dumps a given PHP variable to a YAML string.
Parameters
- $value
- The PHP variable to convert
- $exceptionOnInvalidType
- true if an exception must be thrown on invalid types (a PHP resource or object), false otherwise
- $objectSupport
- true if object support is enabled, false otherwise
Returns
string The YAML string representing the PHP array
Throws
|
public static
string
|
#
parseScalar( string $scalar, string $delimiters = null, array $stringDelimiters = array('"', "'"), integer & $i = 0, boolean $evaluate = true, array $references = array() )
Parses a scalar to a YAML string.
Parses a scalar to a YAML string.
Parameters
- $scalar
- $delimiters
- $stringDelimiters
- $i
- $i
- $evaluate
- $references
Returns
string A YAML string
Throws
|
Constants summary
string |
REGEX_QUOTED_STRING
|
#
'(?:"([^"\\\\]*(?:\\\\.[^"\\\\]*)*)"|\'([^\']*(?:\'\'[^\']*)*)\')'
|