Symfony\Component\Yaml\Parser
Parser parses YAML strings to convert them to PHP arrays.
- Author: Fabien Potencier <fabien@symfony.com>
Synopsis
class Parser
{
- // members
- private integer $offset;
- private array $lines;
- private integer $currentLineNb;
- private string $currentLine;
- private array $refs;
- // methods
- public void __construct()
- public mixed parse()
- private integer getRealCurrentLineNb()
- private integer getCurrentLineIndentation()
- private string getNextEmbedBlock()
- private Boolean moveToNextLine()
- private void moveToPreviousLine()
- private mixed parseValue()
- private string parseFoldedScalar()
- private Boolean isNextLineIndented()
- private Boolean isCurrentLineEmpty()
- private Boolean isCurrentLineBlank()
- private Boolean isCurrentLineComment()
- private string cleanup()
- private Boolean isNextLineUnIndentedCollection()
- private Boolean isStringUnIndentedCollectionItem()
Members
private
- $currentLine
- $currentLineNb
- $lines
- $offset
- $refs
Methods
private
- cleanup() — Cleanups a YAML string to be parsed.
- getCurrentLineIndentation() — Returns the current line indentation.
- getNextEmbedBlock() — Returns the next embed block of YAML.
- getRealCurrentLineNb() — Returns the current line number (takes the offset into account).
- isCurrentLineBlank() — Returns true if the current line is blank.
- isCurrentLineComment() — Returns true if the current line is a comment line.
- isCurrentLineEmpty() — Returns true if the current line is blank or if it is a comment line.
- isNextLineIndented() — Returns true if the next line is indented.
- isNextLineUnIndentedCollection() — Returns true if the next line starts unindented collection
- isStringUnIndentedCollectionItem() — Returns true if the string is un-indented collection item
- moveToNextLine() — Moves the parser to the next line.
- moveToPreviousLine() — Moves the parser to the previous line.
- parseFoldedScalar() — Parses a folded scalar.
- parseValue() — Parses a YAML value.
public
- __construct() — Constructor
- parse() — Parses a YAML string to a PHP value.