class Headers (View source)

Traits

Properties

string|null $messageId

The message's message ID.

array $references

The message IDs that are referenced by the message.

array $text

The message's text headers.

Methods

$this|TWhenReturnType
when($value = null, callable|null $callback = null, callable|null $default = null)

Apply the callback if the given "value" is (or resolves to) truthy.

$this|TUnlessReturnType
unless($value = null, callable|null $callback = null, callable|null $default = null)

Apply the callback if the given "value" is (or resolves to) falsy.

void
__construct(string|null $messageId = null, array $references = [], array $text = [])

Create a new instance of headers for a message.

$this
messageId(string $messageId)

Set the message ID.

$this
references(array $references)

Set the message IDs referenced by this message.

$this
text(array $text)

Set the headers for this message.

string
referencesString()

Get the references header as a string.

Details

$this|TWhenReturnType when($value = null, callable|null $callback = null, callable|null $default = null)

Apply the callback if the given "value" is (or resolves to) truthy.

Parameters

$value
callable|null $callback
callable|null $default

Return Value

$this|TWhenReturnType

$this|TUnlessReturnType unless($value = null, callable|null $callback = null, callable|null $default = null)

Apply the callback if the given "value" is (or resolves to) falsy.

Parameters

$value
callable|null $callback
callable|null $default

Return Value

$this|TUnlessReturnType

void __construct(string|null $messageId = null, array $references = [], array $text = [])

Create a new instance of headers for a message.

Parameters

string|null $messageId
array $references
array $text

Return Value

void

$this messageId(string $messageId)

Set the message ID.

Parameters

string $messageId

Return Value

$this

$this references(array $references)

Set the message IDs referenced by this message.

Parameters

array $references

Return Value

$this

$this text(array $text)

Set the headers for this message.

Parameters

array $text

Return Value

$this

string referencesString()

Get the references header as a string.

Return Value

string