function Parser::lexInlineStructure
2 calls to Parser::lexInlineStructure()
- Parser::lexInlineMapping in vendor/
symfony/ yaml/ Parser.php - Parser::lexInlineSequence in vendor/
symfony/ yaml/ Parser.php
File
-
vendor/
symfony/ yaml/ Parser.php, line 1187
Class
- Parser
- Parser parses YAML strings to convert them to PHP arrays.
Namespace
Symfony\Component\YamlCode
private function lexInlineStructure(int &$cursor, string $closingTag) : string {
$value = $this->currentLine[$cursor];
++$cursor;
do {
$this->consumeWhitespaces($cursor);
while (isset($this->currentLine[$cursor])) {
switch ($this->currentLine[$cursor]) {
case '"':
case "'":
$value .= $this->lexInlineQuotedString($cursor);
break;
case ':':
case ',':
$value .= $this->currentLine[$cursor];
++$cursor;
break;
case '{':
$value .= $this->lexInlineMapping($cursor);
break;
case '[':
$value .= $this->lexInlineSequence($cursor);
break;
case $closingTag:
$value .= $this->currentLine[$cursor];
++$cursor;
return $value;
case '#':
break 2;
default:
$value .= $this->lexUnquotedString($cursor);
}
if ($this->consumeWhitespaces($cursor)) {
$value .= ' ';
}
}
if ($this->hasMoreLines()) {
$cursor = 0;
}
} while ($this->moveToNextLine());
throw new ParseException('Malformed inline YAML string.');
}