a SENSIOLABS Product
Symfony

YAML
A PHP library that speaks YAML

sfYamlParser Class

All Classes

  • sfYaml: sfYaml offers convenience methods to load and dump YAML.
  • sfYamlDumper: sfYamlDumper dumps PHP variables to YAML strings.
  • sfYamlInline: sfYamlInline implements a YAML parser/dumper for the YAML inline syntax.
  • sfYamlParser: sfYamlParser parses YAML strings to convert them to PHP arrays.

RELEASE INFORMATION

You are currently browsing the API for the trunk version.
sfYamlParser parses YAML strings to convert them to PHP arrays.

METHODS
__construct()  constructor
parse()  parses a YAML string to a PHP value.
getRealCurrentLineNb()  returns the current line number (takes the offset into account).
getCurrentLineIndentation()  returns the current line indentation.
getNextEmbedBlock()  returns the next embed block of YAML.
moveToNextLine()  moves the parser to the next line.
moveToPreviousLine()  moves the parser to the previous line.
parseValue()  parses a YAML value.
parseFoldedScalar()  parses a folded scalar.
isNextLineIndented()  returns true if the next line is indented.
isCurrentLineEmpty()  returns true if the current line is blank or if it is a comment line.
isCurrentLineBlank()  returns true if the current line is blank.
isCurrentLineComment()  returns true if the current line is a comment line.
cleanup()  cleanups a YAML string to be parsed.
  • __construct($offset)

    Constructor

    ARGUMENTS
    $offset The offset of YAML document (used for line numbers in error messages)
  • (mixed) parse($value)

    Parses a YAML string to a PHP value.

    ARGUMENTS
    $value A YAML string

    returns A PHP value

    throws InvalidArgumentException If the YAML is not valid

  • (integer) getRealCurrentLineNb()

    Returns the current line number (takes the offset into account).

    returns The current line number

  • (integer) getCurrentLineIndentation()

    Returns the current line indentation.

    returns The current line indentation

  • (string) getNextEmbedBlock($indentation)

    Returns the next embed block of YAML.

    ARGUMENTS
    $indentation The indent level at which the block is to be read, or null for default

    returns A YAML string

  • moveToNextLine()

    Moves the parser to the next line.

  • moveToPreviousLine()

    Moves the parser to the previous line.

  • (mixed) parseValue($value)

    Parses a YAML value.

    ARGUMENTS
    $value A YAML value

    returns A PHP value

  • (string) parseFoldedScalar($separator, $indicator, $indentation)

    Parses a folded scalar.

    ARGUMENTS
    $separator The separator that was used to begin this folded scalar (| or >)
    $indicator The indicator that was used to begin this folded scalar (+ or -)
    $indentation The indentation that was used to begin this folded scalar

    returns The text value

  • (Boolean) isNextLineIndented()

    Returns true if the next line is indented.

    returns Returns true if the next line is indented, false otherwise

  • (Boolean) isCurrentLineEmpty()

    Returns true if the current line is blank or if it is a comment line.

    returns Returns true if the current line is empty or if it is a comment line, false otherwise

  • (Boolean) isCurrentLineBlank()

    Returns true if the current line is blank.

    returns Returns true if the current line is blank, false otherwise

  • (Boolean) isCurrentLineComment()

    Returns true if the current line is a comment line.

    returns Returns true if the current line is a comment line, false otherwise

  • (string) cleanup($value)

    Cleanups a YAML string to be parsed.

    ARGUMENTS
    $value The input YAML string

    returns A cleaned up YAML string

powered by symfony - "symfony" is a trademark of Fabien Potencier, all rights reserved - The components "animals" are © 2009 Sensio Labs

The Sensio Labs Network

Since 1998, Sensio Labs has been promoting the Open-Source software movement by providing quality web application development, training, consulting.
Sensio Labs also supports several large Open-Source projects.