Fork me on Github

Interface Finite\State\ StateInterface

The base State Interface

TYPE_INITIAL

TYPE_NORMAL

TYPE_FINAL

Methods

string getName()

Returns the state name

boolean isInitial()

Returns if this state is the initial state

mixed isFinal()

Returns if this state is the final state

mixed isNormal()

Returns if this state is a normal state (!($this->isInitial() || $this->isFinal())

string getType()

Returns the state type

array getTransitions()

Returns the available transitions

boolean can( string| TransitionInterface $transition)

Returns if this state can run $transition

boolean has( string $property)

mixed get( string $property)

mixed getProperties()

Returns optional state properties

Details

public string getName()

Returns the state name

Return Value
string

public boolean isInitial()

Returns if this state is the initial state

Return Value
boolean

public mixed isFinal()

Returns if this state is the final state

Return Value
mixed

public mixed isNormal()

Returns if this state is a normal state (!($this->isInitial()   $this->isFinal())

Return Value
mixed

public string getType()

Returns the state type

Return Value
string

public array getTransitions()

Returns the available transitions

Return Value
array

public boolean can( string| TransitionInterface $transition)

Returns if this state can run $transition

Parameters
string| TransitionInterface $transition
Return Value
boolean

public boolean has( string $property)

Parameters
string $property
Return Value
boolean

public mixed get( string $property)

Parameters
string $property
Return Value
mixed

public mixed getProperties()

Returns optional state properties

Return Value
mixed