symfony API

sfYamlParser Class

You are currently browsing
the website for symfony 1

Visit the Symfony2 website


« Back to API menu

Packages

You are currently browsing the symfony API for the 1.4 version. Switch to:
This version of symfony is not maintained anymore.
If some of your projects still use this version, consider upgrading as soon as possible.

sfYamlParser parses YAML strings to convert them to PHP arrays.

Method Summary

Method Details

  • (string) cleanup ($value)

    $value The input YAML string

    Cleanups a YAML string to be parsed.

    returns A cleaned up YAML string

  • (integer) getCurrentLineIndentation ()

    Returns the current line indentation.

    returns The current line indentation

  • (string) getNextEmbedBlock ()

    Returns the next embed block of YAML.

    returns A YAML string

  • (integer) getRealCurrentLineNb ()

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

    returns The current line number

  • (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

  • (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) isNextLineIndented ()

    Returns true if the next line is indented.

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

  • moveToNextLine ()

    Moves the parser to the next line.

  • moveToPreviousLine ()

    Moves the parser to the previous line.

  • (mixed) parse ($value)

    $value A YAML string

    Parses a YAML string to a PHP value.

    returns A PHP value

    throws InvalidArgumentException If the YAML is not valid

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

    $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

    Parses a folded scalar.

    returns The text value

  • (mixed) parseValue ($value)

    $value A YAML value

    Parses a YAML value.

    returns A PHP value

  • __construct ($offset)

    $offset The offset of YAML document (used for line numbers in error messages)

    Constructor