File tree Expand file tree Collapse file tree 1 file changed +7
-8
lines changed Expand file tree Collapse file tree 1 file changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -131,26 +131,25 @@ marker, like this::
131131
132132 class MyOwnMiddleware implements MiddlewareInterface, EnvelopeAwareInterface
133133 {
134- public function handle($message , callable $next)
134+ public function handle($envelope , callable $next)
135135 {
136- // $message here is an `Envelope` object, because this middleware
136+ // $envelope here is an `Envelope` object, because this middleware
137137 // implements the EnvelopeAwareInterface interface.
138138
139- if (null !== $message ->get(ReceivedMessage::class)) {
139+ if (null !== $envelope ->get(ReceivedMessage::class)) {
140140 // Message just has been received...
141141
142142 // You could for example add another item.
143- $message = $message ->with(new AnotherEnvelopeItem(/* ... */));
143+ $envelope = $envelope ->with(new AnotherEnvelopeItem(/* ... */));
144144 }
145145
146- return $next($message );
146+ return $next($envelope );
147147 }
148148 }
149149
150150The above example will forward the message to the next middleware with an additional
151- envelope item if the message has just been received (i.e. has the `ReceivedMessage ` item).
152- You can create your own items by implementing the :class: `Symfony\\ Component\\ Messenger\\ EnvelopeAwareInterface `
153- interface.
151+ envelope item *if * the message has just been received (i.e. has the `ReceivedMessage ` item).
152+ You can create your own items by implementing :class: `Symfony\\ Component\\ Messenger\\ EnvelopeAwareInterface `.
154153
155154Transports
156155----------
You can’t perform that action at this time.
0 commit comments