SyncMessage Class

class SyncMessage

Represents a synchronous message

Implements ItemInterface

__construct(string $message, Participant $recipient, ?Participant $sender = null)

Create a new SyncMessage

Parameters:
  • $message (string) – The message

  • $recipient (Participant) – The recipient

  • $sender (?Participant) – The sender (default: External sender)

Returns:

A new SyncMessage instance

Return type:

SyncMessage

addParameter(string ...$parameter)

Add message parameter(s)

Parameters:
  • ...$parameter (string) – Message parameter(s)

Returns:

A new SyncMessage instance with the added parameter(s)

Return type:

SyncMessage

withComment(string $comment)

Set a comment for the SyncMessage

Parameters:
  • $comment (string) – The comment

Returns:

A new instance of SyncMessage with the comment

Return type:

SyncMessage

withParameter(string ...$parameter)

Set message parameter(s)

Parameters:
  • ...$parameter (string) – Message parameter(s)

Returns:

A new SyncMessage instance with the parameter(s)

Return type:

SyncMessage

withReturn(string $value, ?string $type = null)

Set message return value

Parameters:
  • $value (string) – The return value

  • $type (?string) – The return type (default: return type not defined)

Returns:

A new SyncMessage instance with a return message

Return type:

SyncMessage