PHP Class YamlParser, cakephp-db-migrations

Author: Fabien Potencier ([email protected])
Show file Open project: joelmoss/cakephp-db-migrations Class Usage Examples

Protected Properties

Property Type Description
$currentLine
$currentLineNb
$lines
$offset
$refs
$value

Public Methods

Method Description
__construct ( $offset ) Constructor
parse ( $value ) : mixed Parses a YAML string to a PHP value.

Protected Methods

Method Description
cleanup ( $value ) : string Cleanups a YAML string to be parsed.
getCurrentLineIndentation ( ) Returns the current line indentation.
getNextEmbedBlock ( ) Returns the next embed block of YAML.
getRealCurrentLineNb ( ) : integer Returns the current line number (takes the offset into account).
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.
isNextLineIndented ( ) : boolean Returns true if the next line is indented.
moveToNextLine ( ) Moves the parser to the next line.
moveToPreviousLine ( ) Moves the parser to the previous line.
parseFoldedScalar ( $separator, $indicator = '', $indentation ) : string Parses a folded scalar.
parseValue ( $value ) : mixed Parses a YAML value.

Method Details

__construct() public method

Constructor
public __construct ( $offset )

cleanup() protected method

Cleanups a YAML string to be parsed.
protected cleanup ( $value ) : string
return string A cleaned up YAML string

getCurrentLineIndentation() protected method

Returns the current line indentation.

getNextEmbedBlock() protected method

Returns the next embed block of YAML.
protected getNextEmbedBlock ( )

getRealCurrentLineNb() protected method

Returns the current line number (takes the offset into account).
protected getRealCurrentLineNb ( ) : integer
return integer The current line number

isCurrentLineBlank() protected method

Returns true if the current line is blank.
protected isCurrentLineBlank ( ) : boolean
return boolean Returns true if the current line is blank, false otherwise

isCurrentLineComment() protected method

Returns true if the current line is a comment line.
protected isCurrentLineComment ( ) : boolean
return boolean Returns true if the current line is a comment line, false otherwise

isCurrentLineEmpty() protected method

Returns true if the current line is blank or if it is a comment line.
protected isCurrentLineEmpty ( ) : boolean
return boolean Returns true if the current line is empty or if it is a comment line, false otherwise

isNextLineIndented() protected method

Returns true if the next line is indented.
protected isNextLineIndented ( ) : boolean
return boolean Returns true if the next line is indented, false otherwise

moveToNextLine() protected method

Moves the parser to the next line.
protected moveToNextLine ( )

moveToPreviousLine() protected method

Moves the parser to the previous line.
protected moveToPreviousLine ( )

parse() public method

Parses a YAML string to a PHP value.
public parse ( $value ) : mixed
return mixed A PHP value

parseFoldedScalar() protected method

Parses a folded scalar.
protected parseFoldedScalar ( $separator, $indicator = '', $indentation ) : string
return string The text value

parseValue() protected method

Parses a YAML value.
protected parseValue ( $value ) : mixed
return mixed A PHP value

Property Details

$currentLine protected property

protected $currentLine

$currentLineNb protected property

protected $currentLineNb

$lines protected property

protected $lines

$offset protected property

protected $offset

$refs protected property

protected $refs

$value protected property

protected $value