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:

  1. exitCurrent listeners
  2. exiting listeners for old state
  3. global listeners
  4. entering listeners for new state
  5. Changes state
  6. exited listeners for old state
  7. entered listeners for new state

Source

src/Hooks/StateMachine.php:178-207