PHP Class SimpleStateStack, simpletest

ファイルを表示 Open project: simpletest/simpletest Class Usage Examples

Public Methods

Method Description
__construct ( string $start ) Constructor. Starts in named state.
enter ( string $state ) Adds a state to the stack and sets it to be the current state.
getCurrent ( ) : string Accessor for current state.
leave ( ) : boolean Leaves the current state and reverts to the previous one.

Method Details

__construct() public method

Constructor. Starts in named state.
public __construct ( string $start )
$start string Starting state name.

enter() public method

Adds a state to the stack and sets it to be the current state.
public enter ( string $state )
$state string New state.

getCurrent() public method

Accessor for current state.
public getCurrent ( ) : string
return string State.

leave() public method

Leaves the current state and reverts to the previous one.
public leave ( ) : boolean
return boolean False if we drop off the bottom of the list.