Transition Class

Represents a Transition between StateInterface objects

class Transition
__construct(?StateInterface $from = null, ?StateInterface $to = null, ?string $label = null)

Create a Transition

Parameters:
  • $from (?StateInterface) – The state to transition from (default: Start state)

  • $to (?StateInterface) – The state to transition to (default: End state)

  • $label (?string) – A label for the transition (default: no label)

Returns:

An instance of Transition

Return type:

Transition

withComment(string $comment)

Add a comment

Parameters:
  • $comment (string) – The comment

Returns:

A new instance of Transition with the comment

Return type:

Transition