|
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 |
Références Parser\$offset, Parser\$skippedLineNumbers, et Parser\$totalNumberOfLines.
◆ cleanup()
Cleanups a YAML string to be parsed.
- Paramètres
-
string | $value | The input YAML string |
- Renvoie
- string A cleaned up YAML string
Références $count, et $value.
Référencé par Parser\doParse().
◆ doParse()
doParse |
( |
|
$value, |
|
|
|
$exceptionOnInvalidType = false , |
|
|
|
$objectSupport = false , |
|
|
|
$objectForMap = false |
|
) |
| |
|
private |
Références $context, $data, $key, $value, Parser\cleanup(), elseif, Parser\getCurrentLineIndentation(), Parser\getNextEmbedBlock(), Parser\getRealCurrentLineNb(), Parser\isCurrentLineEmpty(), Parser\isNextLineIndented(), Parser\isNextLineUnIndentedCollection(), Parser\moveToNextLine(), null, Inline\parse(), Parser\parseBlock(), Inline\parseScalar(), Parser\parseValue(), Inline\REGEX_QUOTED_STRING, ParseException\setParsedLine(), et ParseException\setSnippet().
Référencé par Parser\parse().
◆ getCurrentLineIndentation()
getCurrentLineIndentation |
( |
| ) |
|
|
private |
◆ 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 |
Références $data, $key, elseif, Parser\getCurrentLineIndentation(), Parser\getRealCurrentLineNb(), Parser\isBlockScalarHeader(), Parser\isCurrentLineBlank(), Parser\isCurrentLineComment(), Parser\isCurrentLineEmpty(), Parser\isStringUnIndentedCollectionItem(), Parser\moveToNextLine(), Parser\moveToPreviousLine(), et null.
Référencé par Parser\doParse().
◆ getRealCurrentLineNb()
◆ isBlockScalarHeader()
◆ isCurrentLineBlank()
◆ isCurrentLineComment()
◆ isCurrentLineEmpty()
◆ isCurrentLineLastLineInDocument()
isCurrentLineLastLineInDocument |
( |
| ) |
|
|
private |
◆ isNextLineIndented()
◆ isNextLineUnIndentedCollection()
isNextLineUnIndentedCollection |
( |
| ) |
|
|
private |
◆ isStringUnIndentedCollectionItem()
isStringUnIndentedCollectionItem |
( |
| ) |
|
|
private |
◆ moveToNextLine()
◆ moveToPreviousLine()
◆ 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 |
Références $data, $value, Parser\doParse(), null, et Parser\preg_match().
◆ parseBlock()
parseBlock |
( |
|
$offset, |
|
|
|
$yaml, |
|
|
|
$exceptionOnInvalidType, |
|
|
|
$objectSupport, |
|
|
|
$objectForMap |
|
) |
| |
|
private |
◆ parseBlockScalar()
parseBlockScalar |
( |
|
$style, |
|
|
|
$chomping = '' , |
|
|
|
$indentation = 0 |
|
) |
| |
|
private |
◆ parseValue()
parseValue |
( |
|
$value, |
|
|
|
$exceptionOnInvalidType, |
|
|
|
$objectSupport, |
|
|
|
$objectForMap, |
|
|
|
$context |
|
) |
| |
|
private |
◆ preg_match()
static preg_match |
( |
|
$pattern, |
|
|
|
$subject, |
|
|
& |
$matches = null , |
|
|
|
$flags = 0 , |
|
|
|
$offset = 0 |
|
) |
| |
|
static |
◆ $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 :