__construct(int $offset, int|null $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 |
array | $skippedLineNumbers | Number of comment lines that have been skipped by the parser |
mixed
parse(string $value, bool $exceptionOnInvalidType = false, bool $objectSupport = false, bool $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() |
Return Value
Exceptions
static
preg_match($pattern, $subject, $matches = null, $flags, $offset)
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
Parameters
| $pattern | |
| $subject | |
| $matches | |
| $flags | |
| $offset | |
Exceptions
See also