|
static | preg_match ($pattern, $subject, &$matches=null, $flags=0, $offset=0) |
|
|
| doParse ($value, $exceptionOnInvalidType=false, $objectSupport=false, $objectForMap=false) |
|
| parseBlock ($offset, $yaml, $exceptionOnInvalidType, $objectSupport, $objectForMap) |
|
| getRealCurrentLineNb () |
|
| getCurrentLineIndentation () |
|
| getNextEmbedBlock ($indentation=null, $inSequence=false) |
|
| moveToNextLine () |
|
| moveToPreviousLine () |
|
| parseValue ($value, $exceptionOnInvalidType, $objectSupport, $objectForMap, $context) |
|
| parseBlockScalar ($style, $chomping='', $indentation=0) |
|
| isNextLineIndented () |
|
| isCurrentLineEmpty () |
|
| isCurrentLineBlank () |
|
| isCurrentLineComment () |
|
| isCurrentLineLastLineInDocument () |
|
| cleanup ($value) |
|
| isNextLineUnIndentedCollection () |
|
| isStringUnIndentedCollectionItem () |
|
| isBlockScalarHeader () |
|
Parser parses YAML strings to convert them to PHP arrays.
- Auteur
- Fabien Potencier fabie.nosp@m.n@sy.nosp@m.mfony.nosp@m..com
◆ __construct()
__construct |
( |
|
$offset = 0 , |
|
|
|
$totalNumberOfLines = null , |
|
|
array |
$skippedLineNumbers = array() |
|
) |
| |
- Paramètres
-
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 |
◆ cleanup()
Cleanups a YAML string to be parsed.
- Paramètres
-
string | $value | The input YAML string |
- Renvoie
- string A cleaned up YAML string
◆ doParse()
doParse |
( |
|
$value, |
|
|
|
$exceptionOnInvalidType = false , |
|
|
|
$objectSupport = false , |
|
|
|
$objectForMap = false |
|
) |
| |
|
private |
◆ getCurrentLineIndentation()
getCurrentLineIndentation |
( |
| ) |
|
|
private |
Returns the current line indentation.
- Renvoie
- int The current line indentation
◆ getNextEmbedBlock()
getNextEmbedBlock |
( |
|
$indentation = null , |
|
|
|
$inSequence = false |
|
) |
| |
|
private |
Returns the next embed block of YAML.
- Paramètres
-
int | $indentation | The indent level at which the block is to be read, or null for default |
bool | $inSequence | True if the enclosing data structure is a sequence |
- Renvoie
- string A YAML string
- Exceptions
-
ParseException | When indentation problem are detected |
◆ getRealCurrentLineNb()
Returns the current line number (takes the offset into account).
- Renvoie
- int The current line number
◆ isBlockScalarHeader()
Tests whether or not the current line is the header of a block scalar.
- Renvoie
- bool
◆ isCurrentLineBlank()
Returns true if the current line is blank.
- Renvoie
- bool Returns true if the current line is blank, false otherwise
◆ isCurrentLineComment()
Returns true if the current line is a comment line.
- Renvoie
- bool Returns true if the current line is a comment line, false otherwise
◆ isCurrentLineEmpty()
Returns true if the current line is blank or if it is a comment line.
- Renvoie
- bool Returns true if the current line is empty or if it is a comment line, false otherwise
◆ isCurrentLineLastLineInDocument()
isCurrentLineLastLineInDocument |
( |
| ) |
|
|
private |
◆ isNextLineIndented()
Returns true if the next line is indented.
- Renvoie
- bool Returns true if the next line is indented, false otherwise
◆ isNextLineUnIndentedCollection()
isNextLineUnIndentedCollection |
( |
| ) |
|
|
private |
Returns true if the next line starts unindented collection.
- Renvoie
- bool Returns true if the next line starts unindented collection, false otherwise
◆ isStringUnIndentedCollectionItem()
isStringUnIndentedCollectionItem |
( |
| ) |
|
|
private |
Returns true if the string is un-indented collection item.
- Renvoie
- bool Returns true if the string is un-indented collection item, false otherwise
◆ moveToNextLine()
Moves the parser to the next line.
- Renvoie
- bool
◆ moveToPreviousLine()
Moves the parser to the previous line.
- Renvoie
- bool
◆ parse()
parse |
( |
|
$value, |
|
|
|
$exceptionOnInvalidType = false , |
|
|
|
$objectSupport = false , |
|
|
|
$objectForMap = false |
|
) |
| |
Parses 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() |
- Renvoie
- mixed A PHP value
- Exceptions
-
ParseException | If the YAML is not valid |
◆ parseBlock()
parseBlock |
( |
|
$offset, |
|
|
|
$yaml, |
|
|
|
$exceptionOnInvalidType, |
|
|
|
$objectSupport, |
|
|
|
$objectForMap |
|
) |
| |
|
private |
◆ parseBlockScalar()
parseBlockScalar |
( |
|
$style, |
|
|
|
$chomping = '' , |
|
|
|
$indentation = 0 |
|
) |
| |
|
private |
Parses a block scalar.
- Paramètres
-
string | $style | The style indicator that was used to begin this block scalar (| or >) |
string | $chomping | The chomping indicator that was used to begin this block scalar (+ or -) |
int | $indentation | The indentation indicator that was used to begin this block scalar |
- Renvoie
- string The text value
◆ parseValue()
parseValue |
( |
|
$value, |
|
|
|
$exceptionOnInvalidType, |
|
|
|
$objectSupport, |
|
|
|
$objectForMap, |
|
|
|
$context |
|
) |
| |
|
private |
Parses a YAML value.
- Paramètres
-
string | $value | A YAML value |
bool | $exceptionOnInvalidType | True if an exception must be thrown on invalid types false otherwise |
bool | $objectSupport | True if object support is enabled, false otherwise |
bool | $objectForMap | True if maps should return a stdClass instead of array() |
string | $context | The parser context (either sequence or mapping) |
- Renvoie
- mixed A PHP value
- Exceptions
-
ParseException | When reference does not exist |
◆ 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 |
- Voir également
- preg_last_error()
◆ $currentLine
◆ $currentLineNb
◆ $lines
◆ $locallySkippedLineNumbers
$locallySkippedLineNumbers = array() |
|
private |
◆ $offset
◆ $refs
◆ $skippedLineNumbers
$skippedLineNumbers = array() |
|
private |
◆ $totalNumberOfLines
◆ 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 |
La documentation de cette classe a été générée à partir du fichier suivant :
- XoopsCore25-2.5.11-Beta1/htdocs/class/libraries/vendor/symfony/yaml/Parser.php