The Finite State Machine base Interface
initialize()
Initialize the State Machine current state |
||
mixed |
apply( string $transitionName)
Apply a transition |
|
bool |
can( string| TransitionInterface $transition)
Returns if the transition is applicable |
|
addState( string| StateInterface $state) | ||
addTransition( string| TransitionInterface $transition, string| null $initialState = null, string| null $finalState = null) | ||
TransitionInterface |
getTransition( string $name)
Returns a transition by its name |
|
StateInterface | getState( string $name) | |
array<string> |
getTransitions()
Returns an array containing all the transitions names |
|
array<string> |
getStates()
Returns an array containing all the states names |
|
setObject( StatefulInterface $object) | ||
StatefulInterface | getObject() | |
StateInterface | getCurrentState() |
public
initialize()
Initialize the State Machine current state
public mixed
apply( string $transitionName)
Apply a transition
Parameters |
|
|||
---|---|---|---|---|
Return Value |
|
public bool
can( string| TransitionInterface $transition)
Returns if the transition is applicable
Parameters |
|
|||
---|---|---|---|---|
Return Value |
|
public
addState( string| StateInterface $state)
public
addTransition( string| TransitionInterface $transition, string| null $initialState = null, string| null $finalState = null)
Parameters |
|
|||||||||
---|---|---|---|---|---|---|---|---|---|---|
Exceptions |
|
public TransitionInterface
getTransition( string $name)
Returns a transition by its name
Parameters |
|
|||
---|---|---|---|---|
Return Value |
|
|||
Exceptions |
|
public StateInterface
getState( string $name)
public array<string>
getTransitions()
Returns an array containing all the transitions names
Return Value |
|
---|
public array<string>
getStates()
Returns an array containing all the states names
Return Value |
|
---|
public
setObject( StatefulInterface $object)
public StatefulInterface
getObject()
public StateInterface
getCurrentState()