|
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()) |
|
|
const | REGEX_QUOTED_STRING = '(?:"([^"\\\\]*+(?:\\\\.[^"\\\\]*+)*+)"|\'([^\']*+(?:\'\'[^\']*+)*+)\')' |
|
Inline implements a YAML parser/dumper for the YAML inline syntax.
- Auteur
- Fabien Potencier fabie.nosp@m.n@sy.nosp@m.mfony.nosp@m..com
◆ dump()
static dump |
( |
|
$value, |
|
|
|
$exceptionOnInvalidType = false , |
|
|
|
$objectSupport = false |
|
) |
| |
|
static |
Dumps a given PHP variable to a YAML string.
- Paramètres
-
mixed | $value | The PHP variable to convert |
bool | $exceptionOnInvalidType | True if an exception must be thrown on invalid types (a PHP resource or object), false otherwise |
bool | $objectSupport | True if object support is enabled, false otherwise |
- Renvoie
- string The YAML string representing the PHP value
- Exceptions
-
DumpException | When trying to dump PHP resource |
Références Inline\$exceptionOnInvalidType, Inline\$objectSupport, $value, elseif, Escaper\escapeWithDoubleQuotes(), Escaper\escapeWithSingleQuotes(), null, Parser\preg_match(), Escaper\requiresDoubleQuoting(), et Escaper\requiresSingleQuoting().
Référencé par Dumper\dump().
◆ dumpArray()
static dumpArray |
( |
|
$value, |
|
|
|
$exceptionOnInvalidType, |
|
|
|
$objectSupport |
|
) |
| |
|
staticprivate |
Dumps a PHP array to a YAML string.
- Paramètres
-
array | $value | The PHP array to dump |
bool | $exceptionOnInvalidType | True if an exception must be thrown on invalid types (a PHP resource or object), false otherwise |
bool | $objectSupport | True if object support is enabled, false otherwise |
- Renvoie
- string The YAML string representing the PHP array
Références Inline\$exceptionOnInvalidType, $key, Inline\$objectSupport, $output, et $value.
◆ evaluateScalar()
static evaluateScalar |
( |
|
$scalar, |
|
|
|
$references = array() |
|
) |
| |
|
staticprivate |
Evaluates scalars and replaces magic values.
- Paramètres
-
string | $scalar | |
array | $references | |
- Renvoie
- mixed The evaluated YAML string
- Exceptions
-
ParseException | when object parsing support was disabled and the parser detected a PHP object or when a reference could not be resolved |
Références $value, et Parser\preg_match().
◆ getHexRegex()
Gets a regex that matches a YAML number in hexadecimal notation.
- Renvoie
- string
◆ getTimestampRegex()
static getTimestampRegex |
( |
| ) |
|
|
staticprivate |
◆ isHash()
static isHash |
( |
array |
$value | ) |
|
|
static |
Check if given array is hash or just normal indexed array.
Références $key, et $value.
Référencé par Dumper\dump().
◆ parse()
static parse |
( |
|
$value, |
|
|
|
$exceptionOnInvalidType = false , |
|
|
|
$objectSupport = false , |
|
|
|
$objectForMap = false , |
|
|
|
$references = array() |
|
) |
| |
|
static |
Converts a YAML string to a PHP value.
- Paramètres
-
string | $value | A YAML string |
bool | $exceptionOnInvalidType | True if an exception must be thrown on invalid types (a PHP resource or object), false otherwise |
bool | $objectSupport | True if object support is enabled, false otherwise |
bool | $objectForMap | True if maps should return a stdClass instead of array() |
array | $references | Mapping of variable names to values |
- Renvoie
- mixed A PHP value
- Exceptions
-
Références Inline\$exceptionOnInvalidType, $i, Inline\$objectForMap, Inline\$objectSupport, $value, et null.
Référencé par Parser\doParse(), et Parser\parseValue().
◆ parseMapping()
static parseMapping |
( |
|
$mapping, |
|
|
& |
$i = 0 , |
|
|
|
$references = array() |
|
) |
| |
|
staticprivate |
Parses a YAML mapping.
- Paramètres
-
string | $mapping | |
int | &$i | |
array | $references | |
- Renvoie
- array|
- Exceptions
-
ParseException | When malformed inline YAML string is parsed |
Références $i, $key, $output, $value, et elseif.
◆ parseQuotedScalar()
static parseQuotedScalar |
( |
|
$scalar, |
|
|
& |
$i |
|
) |
| |
|
staticprivate |
Parses a YAML quoted scalar.
- Paramètres
-
- Renvoie
- string
- Exceptions
-
ParseException | When malformed inline YAML string is parsed |
Références $i, $output, et Parser\preg_match().
◆ parseScalar()
static parseScalar |
( |
|
$scalar, |
|
|
|
$delimiters = null , |
|
|
|
$stringDelimiters = array('"', "'") , |
|
|
& |
$i = 0 , |
|
|
|
$evaluate = true , |
|
|
|
$references = array() |
|
) |
| |
|
static |
Parses a YAML scalar.
- Paramètres
-
string | $scalar | |
| string[] | $delimiters |
| string[] | $stringDelimiters |
int | &$i | |
bool | $evaluate | |
array | $references | |
- Renvoie
- string
- Exceptions
-
ParseException | When malformed inline YAML string is parsed |
Références $i, $output, $tmp, elseif, null, et Parser\preg_match().
Référencé par Parser\doParse().
◆ parseSequence()
static parseSequence |
( |
|
$sequence, |
|
|
& |
$i = 0 , |
|
|
|
$references = array() |
|
) |
| |
|
staticprivate |
Parses a YAML sequence.
- Paramètres
-
string | $sequence | |
int | &$i | |
array | $references | |
- Renvoie
- array
- Exceptions
-
ParseException | When malformed inline YAML string is parsed |
Références $i, $output, et $value.
◆ $exceptionOnInvalidType
$exceptionOnInvalidType = false |
|
staticprivate |
◆ $objectForMap
◆ $objectSupport
◆ REGEX_QUOTED_STRING
const REGEX_QUOTED_STRING = '(?:"([^"\\\\]*+(?:\\\\.[^"\\\\]*+)*+)"|\'([^\']*+(?:\'\'[^\']*+)*+)\')' |
La documentation de cette classe a été générée à partir du fichier suivant :