Closed viktorprogger closed 2 months ago
This PR allows to obtain an envelope instance from envelope stack:
$idEnvelope = $message instanceof EnvelopeInterface ? $message->getEnvelopeFromStack(IdEnvelope::class) : IdEnvelope::fromMessage($message);
If the envelope you need uses EnvelopeTrait, it's more simple: code IdEnvelope::getEnvelopeFromMessage($message) will have the same effect as above.
EnvelopeTrait
IdEnvelope::getEnvelopeFromMessage($message)
This approach will return an unwanted value in case it is overwritten somewhere in stack by an envelope with another class name. Closing.
This PR allows to obtain an envelope instance from envelope stack:
If the envelope you need uses
EnvelopeTrait
, it's more simple: codeIdEnvelope::getEnvelopeFromMessage($message)
will have the same effect as above.