PHP Class Pheasant\Options

Expands any options from int=>key to key=>$default
Inheritance: implements IteratorAggregate
Show file Open project: lox/pheasant Class Usage Examples

Public Methods

Method Description
__construct ( $options, $default = true ) Constructor
__get ( $key )
__isset ( $key )
coerce ( $from ) Convert either a null, a string or an array into an Option
fromString ( $string, $default = true ) : Options Creates an options object from a flat string
getIterator ( ) * (non-phpdoc)
merge ( $array, $default = true ) Merges a new array into the options structure
toString ( $default = true ) Serializes the options to a string.

Method Details

__construct() public method

Constructor
public __construct ( $options, $default = true )

__get() public method

public __get ( $key )

__isset() public method

public __isset ( $key )

coerce() public static method

Convert either a null, a string or an array into an Option
public static coerce ( $from )

fromString() public static method

Creates an options object from a flat string
public static fromString ( $string, $default = true ) : Options
return Options

getIterator() public method

* (non-phpdoc)
See also: IteratorAggregate
public getIterator ( )

merge() public method

Merges a new array into the options structure
public merge ( $array, $default = true )

toString() public method

Serializes the options to a string.
public toString ( $default = true )