State Class¶
- class State¶
Represents a State
- __construct(?string $id, ?string $label)¶
Create a Choice
- Parameters:
$id (
?string) – The state id (default: auto-generate)$label (
?string) – A label for the state(default: use the id)
- Returns:
An instance of
Choice- Return type:
Implements
StateInterface- addGroup(Group ...$group)¶
Adds group(s)
- addState(StateInterface ...$state)¶
Adds state(s)
- Parameters:
...$state (
StateInterface) – The state(s)
- Returns:
A new instance of State with the state(s) added
- Return type:
- addTransition(Transition ...$transition)¶
Adds transition(s)
- Parameters:
...$transition (
Transition) – The transition(s)
- Returns:
A new instance of State with the transition(s) added
- Return type:
- withComment(string $comment)¶
Set a comment
- Parameters:
$comment (
string) – The comment
- Returns:
A new instance of State with a comment
- Return type:
- withGroup(Group ...$group)¶
Set group(s)
- withState(StateInterface ...$state)¶
Set state(s)
- Parameters:
...$state (
StateInterface) – The state(s)
- Returns:
A new instance of State with the state(s)
- Return type:
- withTransition(Transition ...$transition)¶
Sets transition(s)
- Parameters:
...$transition (
Transition) – The transition(s)
- Returns:
A new instance of State with the transition(s)
- Return type: