|
static | preg_match (string $pattern, string $subject, array &$matches=null, int $flags=0, int $offset=0) |
|
|
| doParse (string $value, int $flags) |
|
| parseBlock (int $offset, string $yaml, int $flags) |
|
| getCurrentLineIndentation () |
|
| getNextEmbedBlock (int $indentation=null, bool $inSequence=false) |
|
| hasMoreLines () |
|
| moveToNextLine () |
|
| moveToPreviousLine () |
|
| parseValue (string $value, int $flags, string $context) |
|
| parseBlockScalar (string $style, string $chomping='', int $indentation=0) |
|
| isNextLineIndented () |
|
| isCurrentLineEmpty () |
|
| isCurrentLineBlank () |
|
| isCurrentLineComment () |
|
| isCurrentLineLastLineInDocument () |
|
| cleanup (string $value) |
|
| isNextLineUnIndentedCollection () |
|
| isStringUnIndentedCollectionItem () |
|
| trimTag (string $value) |
|
| getLineTag (string $value, int $flags, bool $nextLineCheck=true) |
|
| lexInlineQuotedString (int &$cursor=0) |
|
| lexUnquotedString (int &$cursor) |
|
| lexInlineMapping (int &$cursor=0) |
|
| lexInlineSequence (int &$cursor=0) |
|
| lexInlineStructure (int &$cursor, string $closingTag) |
|
| consumeWhitespaces (int &$cursor) |
|
Parser parses YAML strings to convert them to PHP arrays.
- Auteur
- Fabien Potencier fabie.nosp@m.n@sy.nosp@m.mfony.nosp@m..com
◆ cleanup()
◆ consumeWhitespaces()
consumeWhitespaces |
( |
int & |
$cursor | ) |
|
|
private |
◆ doParse()
doParse |
( |
string |
$value, |
|
|
int |
$flags |
|
) |
| |
|
private |
Références $context, $data, $key, Parser\$numberOfParsedLines, $value, Parser\cleanup(), elseif, Parser\getCurrentLineIndentation(), Parser\getLineTag(), Parser\getNextEmbedBlock(), Parser\getRealCurrentLineNb(), Inline\initialize(), Parser\isCurrentLineEmpty(), Parser\isNextLineIndented(), Parser\isNextLineUnIndentedCollection(), Parser\lexInlineMapping(), Parser\lexInlineQuotedString(), Parser\lexInlineSequence(), Parser\moveToNextLine(), null, Joomla\Database\Query\offset(), Inline\parse(), Yaml\PARSE_OBJECT_FOR_MAP, Parser\parseBlock(), Inline\parseScalar(), Parser\parseValue(), Inline\REGEX_QUOTED_STRING, ParseException\setParsedLine(), ParseException\setSnippet(), et Parser\trimTag().
Référencé par Parser\parse().
◆ getCurrentLineIndentation()
getCurrentLineIndentation |
( |
| ) |
|
|
private |
◆ getLineTag()
getLineTag |
( |
string |
$value, |
|
|
int |
$flags, |
|
|
bool |
$nextLineCheck = true |
|
) |
| |
|
private |
◆ getNextEmbedBlock()
getNextEmbedBlock |
( |
int |
$indentation = null , |
|
|
bool |
$inSequence = false |
|
) |
| |
|
private |
Returns the next embed block of YAML.
- Paramètres
-
int | null | $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 |
- Exceptions
-
ParseException | When indentation problem are detected |
Références Parser\$currentLine, $data, $i, elseif, Parser\getCurrentLineIndentation(), Parser\getRealCurrentLineNb(), Parser\isCurrentLineBlank(), Parser\isCurrentLineComment(), Parser\isCurrentLineEmpty(), Parser\isStringUnIndentedCollectionItem(), Parser\moveToNextLine(), Parser\moveToPreviousLine(), et null.
Référencé par Parser\doParse().
◆ getRealCurrentLineNb()
◆ hasMoreLines()
◆ isCurrentLineBlank()
◆ isCurrentLineComment()
◆ isCurrentLineEmpty()
◆ isCurrentLineLastLineInDocument()
isCurrentLineLastLineInDocument |
( |
| ) |
|
|
private |
◆ isNextLineIndented()
◆ isNextLineUnIndentedCollection()
isNextLineUnIndentedCollection |
( |
| ) |
|
|
private |
◆ isStringUnIndentedCollectionItem()
isStringUnIndentedCollectionItem |
( |
| ) |
|
|
private |
◆ lexInlineMapping()
lexInlineMapping |
( |
int & |
$cursor = 0 | ) |
|
|
private |
◆ lexInlineQuotedString()
lexInlineQuotedString |
( |
int & |
$cursor = 0 | ) |
|
|
private |
◆ lexInlineSequence()
lexInlineSequence |
( |
int & |
$cursor = 0 | ) |
|
|
private |
◆ lexInlineStructure()
lexInlineStructure |
( |
int & |
$cursor, |
|
|
string |
$closingTag |
|
) |
| |
|
private |
◆ lexUnquotedString()
lexUnquotedString |
( |
int & |
$cursor | ) |
|
|
private |
◆ moveToNextLine()
◆ moveToPreviousLine()
◆ parse()
parse |
( |
string |
$value, |
|
|
int |
$flags = 0 |
|
) |
| |
◆ parseBlock()
parseBlock |
( |
int |
$offset, |
|
|
string |
$yaml, |
|
|
int |
$flags |
|
) |
| |
|
private |
◆ parseBlockScalar()
parseBlockScalar |
( |
string |
$style, |
|
|
string |
$chomping = '' , |
|
|
int |
$indentation = 0 |
|
) |
| |
|
private |
◆ parseFile()
parseFile |
( |
string |
$filename, |
|
|
int |
$flags = 0 |
|
) |
| |
Parses a YAML file into a PHP value.
- Paramètres
-
string | $filename | The path to the YAML file to be parsed |
int | $flags | A bit field of PARSE_* constants to customize the YAML parser behavior |
- Renvoie
- mixed
- Exceptions
-
ParseException | If the file could not be read or the YAML is not valid |
Références Parser\$filename, null, et Parser\parse().
◆ parseValue()
parseValue |
( |
string |
$value, |
|
|
int |
$flags, |
|
|
string |
$context |
|
) |
| |
|
private |
Parses a YAML value.
- Paramètres
-
string | $value | A YAML value |
int | $flags | A bit field of PARSE_* constants to customize the YAML parser behavior |
string | $context | The parser context (either sequence or mapping) |
- Renvoie
- mixed
- Exceptions
-
ParseException | When reference does not exist |
Références $context, $data, $i, Parser\$lines, Inline\$parsedLineNumber, $value, elseif, Inline\evaluateBinaryScalar(), Parser\getCurrentLineIndentation(), Parser\getRealCurrentLineNb(), Parser\lexInlineMapping(), Parser\lexInlineQuotedString(), Parser\lexInlineSequence(), Parser\moveToNextLine(), Parser\moveToPreviousLine(), Inline\parse(), Parser\parseBlockScalar(), ParseException\setParsedLine(), et ParseException\setSnippet().
Référencé par Parser\doParse().
◆ preg_match()
static preg_match |
( |
string |
$pattern, |
|
|
string |
$subject, |
|
|
array & |
$matches = null , |
|
|
int |
$flags = 0 , |
|
|
int |
$offset = 0 |
|
) |
| |
|
static |
◆ trimTag()
Trim the tag on top of the value.
Prevent values such as "!foo {quz: bar}" to be considered as a mapping block.
Références $value.
Référencé par Parser\doParse().
◆ $currentLine
◆ $currentLineNb
◆ $filename
◆ $lines
◆ $locallySkippedLineNumbers
$locallySkippedLineNumbers = [] |
|
private |
◆ $numberOfParsedLines
◆ $offset
◆ $refs
◆ $refsBeingParsed
◆ $skippedLineNumbers
◆ $totalNumberOfLines
◆ BLOCK_SCALAR_HEADER_PATTERN
const BLOCK_SCALAR_HEADER_PATTERN = '(?P<separator>\||>)(?P<modifiers>\+|\-|\d+|\+\d+|\-\d+|\d+\+|\d+\-)?(?P<comments> +#.*)?' |
◆ REFERENCE_PATTERN
const REFERENCE_PATTERN = '#^&(?P<ref>[^ ]++) *+(?P<value>.*)#u' |
◆ TAG_PATTERN
const TAG_PATTERN = '(?P<tag>![\w!.\/:-]+)' |
La documentation de cette classe a été générée à partir du fichier suivant :