PHP Class YamlInline, cakephp-db-migrations

Author: Fabien Potencier ([email protected])
显示文件 Open project: joelmoss/cakephp-db-migrations Class Usage Examples

Public Methods

Method Description
dump ( $value ) : string Dumps PHP array to YAML.
load ( $value ) : array Load YAML into a PHP array.
parseScalar ( scalar $scalar, string $delimiters = null, $stringDelimiters = ['"', "'"], integer &$i, boolean $evaluate = true ) : string Parses scalar to yaml

Protected Methods

Method Description
dumpArray ( $value ) : string Dumps PHP array to YAML
evaluateScalar ( string $scalar ) : string Evaluates scalars and replaces magic values.
getTimestampRegex ( )
parseMapping ( string $mapping, integer &$i ) : string Parses mapping.
parseQuotedScalar ( string $scalar, integer &$i ) : string Parses quotes scalar
parseSequence ( string $sequence, integer &$i ) : string Parse sequence to yaml

Method Details

dump() public static method

Dumps PHP array to YAML.
public static dump ( $value ) : string
return string YAML

dumpArray() protected static method

Dumps PHP array to YAML
protected static dumpArray ( $value ) : string
return string YAML

evaluateScalar() protected static method

Evaluates scalars and replaces magic values.
protected static evaluateScalar ( string $scalar ) : string
$scalar string
return string YAML

getTimestampRegex() protected static method

protected static getTimestampRegex ( )

load() public static method

Load YAML into a PHP array.
public static load ( $value ) : array
return array PHP array

parseMapping() protected static method

Parses mapping.
protected static parseMapping ( string $mapping, integer &$i ) : string
$mapping string
$i integer
return string YAML

parseQuotedScalar() protected static method

Parses quotes scalar
protected static parseQuotedScalar ( string $scalar, integer &$i ) : string
$scalar string
$i integer
return string YAML

parseScalar() public static method

Parses scalar to yaml
public static parseScalar ( scalar $scalar, string $delimiters = null, $stringDelimiters = ['"', "'"], integer &$i, boolean $evaluate = true ) : string
$scalar scalar
$delimiters string
$i integer
$evaluate boolean
return string YAML

parseSequence() protected static method

Parse sequence to yaml
protected static parseSequence ( string $sequence, integer &$i ) : string
$sequence string
$i integer
return string YAML