API - XOOPS 2.5.11 Beta 2
By monxoops.fr
Inline Class Reference

Static Public Member Functions

static parse ($value, $exceptionOnInvalidType=false, $objectSupport=false, $objectForMap=false, $references=array())
 
static dump ($value, $exceptionOnInvalidType=false, $objectSupport=false)
 
static isHash (array $value)
 
static parseScalar ($scalar, $delimiters=null, $stringDelimiters=array('"', "'"), &$i = 0, $evaluate = true, $references = array())
 

Data Fields

const REGEX_QUOTED_STRING = '(?:"([^"\\\\]*+(?:\\\\.[^"\\\\]*+)*+)"|\'([^\']*+(?:\'\'[^\']*+)*+)\')'
 

Detailed Description

Inline implements a YAML parser/dumper for the YAML inline syntax.

Author
Fabien Potencier fabie.nosp@m.n@sy.nosp@m.mfony.nosp@m..com

Member Function Documentation

◆ dump()

static dump (   $value,
  $exceptionOnInvalidType = false,
  $objectSupport = false 
)
static

Dumps a given PHP variable to a YAML string.

Parameters
mixed$valueThe PHP variable to convert
bool$exceptionOnInvalidTypeTrue if an exception must be thrown on invalid types (a PHP resource or object), false otherwise
bool$objectSupportTrue if object support is enabled, false otherwise
Returns
string The YAML string representing the PHP value
Exceptions
DumpExceptionWhen trying to dump PHP resource
Here is the call graph for this function:
Here is the caller graph for this function:

◆ isHash()

static isHash ( array  $value)
static

Check if given array is hash or just normal indexed array.

Here is the caller graph for this function:

◆ parse()

static parse (   $value,
  $exceptionOnInvalidType = false,
  $objectSupport = false,
  $objectForMap = false,
  $references = array() 
)
static

Converts a YAML string to a PHP value.

Parameters
string$valueA YAML string
bool$exceptionOnInvalidTypeTrue if an exception must be thrown on invalid types (a PHP resource or object), false otherwise
bool$objectSupportTrue if object support is enabled, false otherwise
bool$objectForMapTrue if maps should return a stdClass instead of array()
array$referencesMapping of variable names to values
Returns
mixed A PHP value
Exceptions
ParseException
Here is the call graph for this function:
Here is the caller graph for this function:

◆ parseScalar()

static parseScalar (   $scalar,
  $delimiters = null,
  $stringDelimiters = array('"', "'"),
$i = 0,
  $evaluate = true,
  $references = array() 
)
static

Parses a YAML scalar.

Parameters
string$scalar
string[]$delimiters
string[]$stringDelimiters
int&$i
bool$evaluate
array$references
Returns
string
Exceptions
ParseExceptionWhen malformed inline YAML string is parsed
Here is the call graph for this function:
Here is the caller graph for this function:

Field Documentation

◆ REGEX_QUOTED_STRING

const REGEX_QUOTED_STRING = '(?:"([^"\\\\]*+(?:\\\\.[^"\\\\]*+)*+)"|\'([^\']*+(?:\'\'[^\']*+)*+)\')'

The documentation for this class was generated from the following file: