mini\Hooks\StateMachine::trigger()
Method
public
Signature
public function trigger(UnitEnum|string|int $targetState): void
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$targetState |
UnitEnum|string|int |
required | Documentation missing |
Returns
void
Documentation
Transition to a new state
Validates the transition is legal, then fires hooks in this order:
- exitCurrent listeners
- exiting listeners for old state
- global listeners
- entering listeners for new state
- Changes state
- exited listeners for old state
- entered listeners for new state