| METHODS | |
|---|---|
__construct()
| constructor |
parse()
| parses a YAML string to a PHP value. |
getRealCurrentLineNb()
| returns the current line number (takes the offset into account). |
getCurrentLineIndentation()
| returns the current line indentation. |
getNextEmbedBlock()
| returns the next embed block of YAML. |
moveToNextLine()
| moves the parser to the next line. |
moveToPreviousLine()
| moves the parser to the previous line. |
parseValue()
| parses a YAML value. |
parseFoldedScalar()
| parses a folded scalar. |
isNextLineIndented()
| returns true if the next line is indented. |
isCurrentLineEmpty()
| returns true if the current line is blank or if it is a comment line. |
isCurrentLineBlank()
| returns true if the current line is blank. |
isCurrentLineComment()
| returns true if the current line is a comment line. |
cleanup()
| cleanups a YAML string to be parsed. |
Constructor
| ARGUMENTS | |
|---|---|
$offset |
The offset of YAML document (used for line numbers in error messages) |
Parses a YAML string to a PHP value.
| ARGUMENTS | |
|---|---|
$value |
A YAML string |
returns A PHP value
throws InvalidArgumentException If the YAML is not valid
Returns the current line number (takes the offset into account).
returns The current line number
Returns the current line indentation.
returns The current line indentation
Returns the next embed block of YAML.
| ARGUMENTS | |
|---|---|
$indentation |
The indent level at which the block is to be read, or null for default |
returns A YAML string
Moves the parser to the next line.
Moves the parser to the previous line.
Parses a YAML value.
| ARGUMENTS | |
|---|---|
$value |
A YAML value |
returns A PHP value
Parses a folded scalar.
| ARGUMENTS | |
|---|---|
$separator |
The separator that was used to begin this folded scalar (| or >) |
$indicator |
The indicator that was used to begin this folded scalar (+ or -) |
$indentation |
The indentation that was used to begin this folded scalar |
returns The text value
Returns true if the next line is indented.
returns Returns true if the next line is indented, false otherwise
Returns true if the current line is blank or if it is a comment line.
returns Returns true if the current line is empty or if it is a comment line, false otherwise
Returns true if the current line is blank.
returns Returns true if the current line is blank, false otherwise
Returns true if the current line is a comment line.
returns Returns true if the current line is a comment line, false otherwise
Cleanups a YAML string to be parsed.
| ARGUMENTS | |
|---|---|
$value |
The input YAML string |
returns A cleaned up YAML string
