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 )
Converts a YAML string to a PHP array.
Converts a YAML string to a PHP array.
Parameters
- $value
string $value A YAML string
- $exceptionOnInvalidType
Boolean $exceptionOnInvalidType true if an exception must be thrown on invalid types (a
PHP resource or object), false otherwise
- $objectSupport
Boolean $objectSupport true if object support is enabled, false otherwise
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
mixed $value The PHP variable to convert
- $exceptionOnInvalidType
Boolean $exceptionOnInvalidType true if an exception must be thrown on invalid types (a
PHP resource or object), false otherwise
- $objectSupport
Boolean $objectSupport true if object support is enabled, false otherwise
Returns
string The YAML string representing the PHP array
Throws
|
public static
string
|
#
parseScalar( scalar $scalar, string $delimiters = null, array $stringDelimiters = array('"', "'"), integer & $i = 0, Boolean $evaluate = true )
Parses a scalar to a YAML string.
Parses a scalar to a YAML string.
Parameters
- $scalar
scalar $scalar
- $delimiters
string $delimiters
- $stringDelimiters
array $stringDelimiters
- $i
integer &$i
- $evaluate
Boolean $evaluate
Returns
string A YAML string
Throws
|
Constants summary
string |
REGEX_QUOTED_STRING
|
'(?:"([^"\\\\]*(?:\\\\.[^"\\\\]*)*)"|\'([^\']*(?:\'\'[^\']*)*)\')' |
|