Task Class

class Task

Represents a Task in a User Journey Section

__construct(string $name, int $score, bool $sort = false)

Creates a new task

Parameters:
  • $name (string) – The task name

  • $score (int) – The task score. 1 <= $score <= 5

Returns:

A new instance of Task

Return type:

Task

addActor(Actor ...$actor)

Add actor(s)

Parameters:
  • ...$actor (Actor) – The actor(s)

Returns:

A new instance of Task with the actor(s) added

Return type:

Task

withComment(string $comment)

Add a comment

Parameters:
  • $comment (string) – The comment

Returns:

A new instance of Task with the comment

Return type:

Task

withActor(Actor ...$actor)

Set actor(s)

Parameters:
  • ...$actor (Actor) – The actor(s)

Returns:

A new instance of Task with the actor(s)

Return type:

Task

withSortActors()

Enable sorting the actors

Default is to render the actors in the order added

Parameters:
  • ...$actor (Actor) – The actor(s)

Returns:

A new instance of Task that will sort the actors

Return type:

Task