Skip to content

Commit 90ca4bc

Browse files
committed
Merge branch '4.2'
* 4.2: [Messenger] Collect all stamps added on Envelope
2 parents bf726d3 + 764066a commit 90ca4bc

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

components/messenger.rst

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -174,9 +174,15 @@ Hence you can inspect the envelope content and its stamps, or add any::
174174
}
175175
}
176176

177-
The above example will forward the message to the next middleware with an additional
178-
stamp *if* the message has just been received (i.e. has the `ReceivedStamp` stamp).
179-
You can create your own stamps by implementing :class:`Symfony\\Component\\Messenger\\Stamp\\StampInterface`.
177+
The above example will forward the message to the next middleware with an
178+
additional stamp *if* the message has just been received (i.e. has at least one
179+
``ReceivedStamp`` stamp). You can create your own stamps by implementing
180+
:class:`Symfony\\Component\\Messenger\\Stamp\\StampInterface`.
181+
182+
If you want to examine all stamps on an envelope, use the ``$envelope->all()``
183+
method, which returns all stamps grouped by type (FQCN). Alternatively, you can
184+
iterate through all stamps of a specific type by using the FQCN as first
185+
parameter of this method (e.g. ``$envelope->all(ReceivedStamp::class)``).
180186

181187
.. note::
182188

0 commit comments

Comments
 (0)