Fork me on Github

Class Finite\Transition\ Transition

The base Transition class.

Feel free to extend it to fit to your needs


Implements: TransitionInterface

Methods

__construct( string $name, string| array $initialStates, string $state)

addInitialState( string| StateInterface $state)

array getInitialStates()

Returns the array of states that supports this transition

string getState()

Returns the state resulting of this transition

mixed process( StateMachine $stateMachine)

Process the transition

string getName()

Returns the name of the transition

string __toString()

Details

public __construct( string $name, string| array $initialStates, string $state)

Parameters
string $name
string| array $initialStates
string $state

public addInitialState( string| StateInterface $state)

Parameters
string| StateInterface $state

public array getInitialStates()

Returns the array of states that supports this transition

Return Value
array

public string getState()

Returns the state resulting of this transition

Return Value
string

public mixed process( StateMachine $stateMachine)

Process the transition

Parameters
StateMachine $stateMachine
Return Value
mixed

public string getName()

Returns the name of the transition

Return Value
string

public string __toString()

Return Value
string