|
| __construct ($offset=0, $totalNumberOfLines=null, array $skippedLineNumbers=array()) |
|
| parse ($value, $exceptionOnInvalidType=false, $objectSupport=false, $objectForMap=false) |
|
|
static | preg_match ($pattern, $subject, &$matches=null, $flags=0, $offset=0) |
|
Parser parses YAML strings to convert them to PHP arrays.
- Author
- Fabien Potencier fabie.nosp@m.n@sy.nosp@m.mfony.nosp@m..com
◆ __construct()
__construct |
( |
|
$offset = 0 , |
|
|
|
$totalNumberOfLines = null , |
|
|
array |
$skippedLineNumbers = array() |
|
) |
| |
- Parameters
-
int | $offset | The offset of YAML document (used for line numbers in error messages) |
int | null | $totalNumberOfLines | The overall number of lines being parsed |
int[] | $skippedLineNumbers | Number of comment lines that have been skipped by the parser |
◆ parse()
parse |
( |
|
$value, |
|
|
|
$exceptionOnInvalidType = false , |
|
|
|
$objectSupport = false , |
|
|
|
$objectForMap = false |
|
) |
| |
Parses a YAML string to a PHP value.
- Parameters
-
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() |
- Returns
- mixed A PHP value
- Exceptions
-
ParseException | If the YAML is not valid |
◆ preg_match()
static preg_match |
( |
|
$pattern, |
|
|
|
$subject, |
|
|
& |
$matches = null , |
|
|
|
$flags = 0 , |
|
|
|
$offset = 0 |
|
) |
| |
|
static |
A local wrapper for preg_match
which will throw a ParseException if there is an internal error in the PCRE engine.
This avoids us needing to check for "false" every time PCRE is used in the YAML engine
- Exceptions
-
ParseException | on a PCRE internal error |
- See also
- preg_last_error()
◆ BLOCK_SCALAR_HEADER_PATTERN
const BLOCK_SCALAR_HEADER_PATTERN = '(?P<separator>\||>)(?P<modifiers>\+|\-|\d+|\+\d+|\-\d+|\d+\+|\d+\-)?(?P<comments> +#.*)?' |
◆ FOLDED_SCALAR_PATTERN
const FOLDED_SCALAR_PATTERN = self::BLOCK_SCALAR_HEADER_PATTERN |
The documentation for this class was generated from the following file:
- C:/xoops2511b2/htdocs/class/libraries/vendor/symfony/yaml/Parser.php