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:

Choice

Implements StateInterface

addGroup(Group ...$group)

Adds group(s)

Parameters:
  • ...$group (Group) – The group(s)

Returns:

A new instance of State with the group(s) added

Return type:

State

addState(StateInterface ...$state)

Adds state(s)

Parameters:
Returns:

A new instance of State with the state(s) added

Return type:

State

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:

State

withComment(string $comment)

Set a comment

Parameters:
  • $comment (string) – The comment

Returns:

A new instance of State with a comment

Return type:

State

withGroup(Group ...$group)

Set group(s)

Parameters:
  • ...$group (Group) – The group(s)

Returns:

A new instance of State with the group(s)

Return type:

State

withState(StateInterface ...$state)

Set state(s)

Parameters:
Returns:

A new instance of State with the state(s)

Return type:

State

withTransition(Transition ...$transition)

Sets transition(s)

Parameters:
  • ...$transition (Transition) – The transition(s)

Returns:

A new instance of State with the transition(s)

Return type:

State