PHP Class Symfony\Component\Yaml\Parser

Author: Fabien Potencier ([email protected])
Datei anzeigen Open project: symfony/symfony Class Usage Examples

Public Methods

Method Description
__construct ( integer $offset, integer | null $totalNumberOfLines = null, array $skippedLineNumbers = [] ) Constructor.
parse ( string $value, integer $flags ) : mixed Parses a YAML string to a PHP value.

Private Methods

Method Description
cleanup ( string $value ) : string Cleanups a YAML string to be parsed.
getCurrentLineIndentation ( ) : integer Returns the current line indentation.
getNextEmbedBlock ( integer $indentation = null, boolean $inSequence = false ) : string Returns the next embed block of YAML.
getRealCurrentLineNb ( ) : integer Returns the current line number (takes the offset into account).
isBlockScalarHeader ( ) : boolean Tests whether or not the current line is the header of a block scalar.
isCurrentLineBlank ( ) : boolean Returns true if the current line is blank.
isCurrentLineComment ( ) : boolean Returns true if the current line is a comment line.
isCurrentLineEmpty ( ) : boolean Returns true if the current line is blank or if it is a comment line.
isCurrentLineLastLineInDocument ( )
isNextLineIndented ( ) : boolean Returns true if the next line is indented.
isNextLineUnIndentedCollection ( ) : boolean Returns true if the next line starts unindented collection.
isStringUnIndentedCollectionItem ( ) : boolean Returns true if the string is un-indented collection item.
moveToNextLine ( ) : boolean Moves the parser to the next line.
moveToPreviousLine ( ) : boolean Moves the parser to the previous line.
parseBlock ( $offset, $yaml, $flags )
parseBlockScalar ( string $style, string $chomping = '', integer $indentation ) : string Parses a block scalar.
parseValue ( string $value, integer $flags, string $context ) : mixed Parses a YAML value.

Method Details

__construct() public method

Constructor.
public __construct ( integer $offset, integer | null $totalNumberOfLines = null, array $skippedLineNumbers = [] )
$offset integer The offset of YAML document (used for line numbers in error messages)
$totalNumberOfLines integer | null The overall number of lines being parsed
$skippedLineNumbers array Number of comment lines that have been skipped by the parser

parse() public method

Parses a YAML string to a PHP value.
public parse ( string $value, integer $flags ) : mixed
$value string A YAML string
$flags integer A bit field of PARSE_* constants to customize the YAML parser behavior
return mixed A PHP value